# django-ticket
Ticket application for django project
## Repository
You can find the source code and contribute to the project at the following link:
[GitHub Repository](https://github.com/HosseinSayyedMousavi/django-ticket)
## Contributors
- [Abbas Ebadian](https://github.com/AbbasEbadian) - Founder of the project
- [Hossein Sayyedmousavi](https://github.com/HosseinSayyedMousavi) - Primary Developer and Contributorand Contributor
## Installation
### 1. install package
```
pip install django-ticket
```
### 2. add this application in settings.INSTALLED_APPS :
```
INSTALLED_APPS = [
# ...
'ticket',
# ...
]
```
### 3. create and migrate migrations in BASE_DIR:
python manage.py migrate ticket
### 4. in core application include application urls:
```
from django.urls import path , include
urlpatterns += path("ticket/", include("ticket.urls"))
```
when you pass this missions you will see this in your admin panel:
![Screenshot from 2024-01-14 10-07-30](https://github.com/HosseinSayyedMousavi/django-ticket/assets/104124540/15d7ba19-c157-4cb0-a4a5-330101641b19)
## API Documentation:
You can create a Ticket from admin panel for a user to admin.
Note that and you can do all this operations from admin to a user
### /ticket/
Create a ticket from user to admin and add a new message:
method: ```POST```
required keywords : ```("title","section","priority","message")```
### /ticket/
Get all tickets of user as a list
method: ```GET```
required keywords : ```just must to be authorized.```
### /ticket/id/
Add message to a ticket with its id :
method: ```POST```
required keywords : ```("message",)```
Note: id means ticket's id
### /ticket/id/
Get a specific ticket by detail with its messages by it's id and Change ticket to seen state from user
method: ```GET```
required keywords : ```just must to be authorized.```
Note: id means ticket's id
### /ticket/id/
Close ticket.
method: ```PATCH```
required keywords : ```just must to be authorized.```
Note: id means ticket's id
## A little more Professional
You can filter and have not seen tickets in admin panel:
### settings.py:
### 1. Add 'ticket/templates' to DIRS of TEMPLATES:
```
TEMPLATES = [
{
# ...
'DIRS': [
# ...
'ticket/templates'
# ...
],
# ...
}
]
```
### 2.Add 'ticket.context_processors.get_pending_tickets' to context_processors OPTIONS:
```
TEMPLATES = [
# ...
"OPTIONS": {
# ...
"context_processors": [
# ...
'ticket.context_processors.get_pending_tickets'
# ...
]
# ...
}
]
```
Finally your application is complete to use:
![Screenshot from 2024-01-14 10-19-39](https://github.com/HosseinSayyedMousavi/django-ticket/assets/104124540/c68600d9-1e9f-4f5a-9a7a-8ba4644a8bec)
Let's enjoy!
# Changelog
## [Version 3.1.1] - 2024-10-29
### Added
- `soft_delete` attribute ticket and messages.
- `viewed` attribute view time of a message.
- `viewer` attribute viewer user of a message.
- `swagger` api docs and schemas.
### Changed
- Make urls `RESTFUL`. just one address -> /ticket/
### Deprecated
- See ticket with an endpoint. `seen_by_user` by get ticket in detail
### Fixed
- `seen_by_admin` switches to True when open ticket object in admin panel
Raw data
{
"_id": null,
"home_page": "https://github.com/HosseinSayyedMousavi/django-ticket",
"name": "django-ticket",
"maintainer": "Hossein Sayyedmousavi",
"docs_url": null,
"requires_python": null,
"maintainer_email": "Hossein.Sayyedmousavi@gmail.com",
"keywords": "django, database, ticket",
"author": "Abbas Ebadian",
"author_email": "AbbasEbadiann@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7a/57/daf176b14afd1526de7496a0a1b0806e4f0774ea292cc5ae8c7a7792130a/django-ticket-3.1.2.tar.gz",
"platform": null,
"description": "# django-ticket\nTicket application for django project\n\n## Repository\n\nYou can find the source code and contribute to the project at the following link:\n\n[GitHub Repository](https://github.com/HosseinSayyedMousavi/django-ticket)\n\n## Contributors\n\n- [Abbas Ebadian](https://github.com/AbbasEbadian) - Founder of the project\n- [Hossein Sayyedmousavi](https://github.com/HosseinSayyedMousavi) - Primary Developer and Contributorand Contributor\n\n\n## Installation\n### 1. install package\n```\npip install django-ticket\n```\n\n### 2. add this application in settings.INSTALLED_APPS :\n```\nINSTALLED_APPS = [\n # ...\n 'ticket',\n # ...\n]\n```\n### 3. create and migrate migrations in BASE_DIR: \n python manage.py migrate ticket\n\n### 4. in core application include application urls:\n```\nfrom django.urls import path , include\n\nurlpatterns += path(\"ticket/\", include(\"ticket.urls\"))\n```\n\nwhen you pass this missions you will see this in your admin panel:\n\n\n![Screenshot from 2024-01-14 10-07-30](https://github.com/HosseinSayyedMousavi/django-ticket/assets/104124540/15d7ba19-c157-4cb0-a4a5-330101641b19)\n\n\n## API Documentation:\nYou can create a Ticket from admin panel for a user to admin.\nNote that and you can do all this operations from admin to a user\n\n### /ticket/\nCreate a ticket from user to admin and add a new message:\n\nmethod: ```POST```\n\nrequired keywords : ```(\"title\",\"section\",\"priority\",\"message\")```\n\n### /ticket/\nGet all tickets of user as a list\n\nmethod: ```GET```\n\nrequired keywords : ```just must to be authorized.```\n\n\n### /ticket/id/\nAdd message to a ticket with its id :\n\nmethod: ```POST```\n\nrequired keywords : ```(\"message\",)```\n\nNote: id means ticket's id\n\n### /ticket/id/\nGet a specific ticket by detail with its messages by it's id and Change ticket to seen state from user\n\nmethod: ```GET```\n\nrequired keywords : ```just must to be authorized.```\n\nNote: id means ticket's id\n\n### /ticket/id/\nClose ticket.\n\nmethod: ```PATCH```\n\nrequired keywords : ```just must to be authorized.```\n\nNote: id means ticket's id\n\n\n\n## A little more Professional\nYou can filter and have not seen tickets in admin panel:\n### settings.py:\n\n### 1. Add 'ticket/templates' to DIRS of TEMPLATES:\n```\nTEMPLATES = [\n {\n # ...\n 'DIRS': [\n # ...\n 'ticket/templates'\n # ...\n ],\n # ...\n }\n]\n```\n\n### 2.Add 'ticket.context_processors.get_pending_tickets' to context_processors OPTIONS:\n```\nTEMPLATES = [\n # ...\n \"OPTIONS\": {\n # ...\n \"context_processors\": [\n # ...\n 'ticket.context_processors.get_pending_tickets'\n # ...\n ]\n # ...\n }\n]\n```\nFinally your application is complete to use:\n\n\n![Screenshot from 2024-01-14 10-19-39](https://github.com/HosseinSayyedMousavi/django-ticket/assets/104124540/c68600d9-1e9f-4f5a-9a7a-8ba4644a8bec)\n\nLet's enjoy!\n\n\n# Changelog\n\n## [Version 3.1.1] - 2024-10-29\n### Added\n- `soft_delete` attribute ticket and messages.\n- `viewed` attribute view time of a message.\n- `viewer` attribute viewer user of a message.\n- `swagger` api docs and schemas.\n\n### Changed\n- Make urls `RESTFUL`. just one address -> /ticket/\n\n### Deprecated\n- See ticket with an endpoint. `seen_by_user` by get ticket in detail\n\n### Fixed\n- `seen_by_admin` switches to True when open ticket object in admin panel\n\n\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "A ticket application for Django projects",
"version": "3.1.2",
"project_urls": {
"Homepage": "https://github.com/HosseinSayyedMousavi/django-ticket"
},
"split_keywords": [
"django",
" database",
" ticket"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b74d8915c63ae197b6e504c3008819c2f826b9f79874ba658bb510da5b542b0b",
"md5": "14397d9b0992449208d03405d96b0ddf",
"sha256": "111ce4504b3fc84ad64af1cf1def3955984e96301601a82915f35f4c0b0d2af5"
},
"downloads": -1,
"filename": "django_ticket-3.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "14397d9b0992449208d03405d96b0ddf",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9820,
"upload_time": "2024-10-29T13:07:39",
"upload_time_iso_8601": "2024-10-29T13:07:39.683195Z",
"url": "https://files.pythonhosted.org/packages/b7/4d/8915c63ae197b6e504c3008819c2f826b9f79874ba658bb510da5b542b0b/django_ticket-3.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7a57daf176b14afd1526de7496a0a1b0806e4f0774ea292cc5ae8c7a7792130a",
"md5": "a267e403fcd2f8f1228f0a39bff1b6bf",
"sha256": "5c2d2834dc77863104df31cf31c5a1f0ebe1fb3ef249252b7f3c24a36fb25e9f"
},
"downloads": -1,
"filename": "django-ticket-3.1.2.tar.gz",
"has_sig": false,
"md5_digest": "a267e403fcd2f8f1228f0a39bff1b6bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7784,
"upload_time": "2024-10-29T13:07:41",
"upload_time_iso_8601": "2024-10-29T13:07:41.522771Z",
"url": "https://files.pythonhosted.org/packages/7a/57/daf176b14afd1526de7496a0a1b0806e4f0774ea292cc5ae8c7a7792130a/django-ticket-3.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-29 13:07:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "HosseinSayyedMousavi",
"github_project": "django-ticket",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-ticket"
}