{"id":13814040,"url":"https://github.com/streeter/django-ticketing","last_synced_at":"2025-03-21T22:31:39.599Z","repository":{"id":57422358,"uuid":"1472978","full_name":"streeter/django-ticketing","owner":"streeter","description":"An implementation of a ticketing model like the one described by Flickr.","archived":false,"fork":false,"pushed_at":"2015-05-20T18:08:42.000Z","size":322,"stargazers_count":19,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-18T05:43:54.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pypi.python.org/pypi/django-ticketing/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/streeter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-03-12T22:55:07.000Z","updated_at":"2019-06-30T11:01:22.000Z","dependencies_parsed_at":"2022-09-13T15:12:50.097Z","dependency_job_id":null,"html_url":"https://github.com/streeter/django-ticketing","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streeter%2Fdjango-ticketing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streeter%2Fdjango-ticketing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streeter%2Fdjango-ticketing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streeter%2Fdjango-ticketing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streeter","download_url":"https://codeload.github.com/streeter/django-ticketing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880265,"owners_count":20525505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T04:01:40.952Z","updated_at":"2025-03-21T22:31:39.230Z","avatar_url":"https://github.com/streeter.png","language":"Python","readme":"## About\n\nAn implementation of a Django model that returns tickets, as described\nin the [Flickr blog post][flickr]. Currently, requires MySQL and Django 1.6 or\nhigher.\n\n## Installation\n\nI uploaded it to [PyPi][pypi], so you can grab it there if you'd like with\n\n```\npip install django-ticketing\n```\n\nor install it with pip using the git address:\n\n```\npip install git+git@github.com:streeter/django-ticketing.git\n```\n\nThen add `ticketing` to your `INSTALLED\\_APPS`.\n\n## Usage\n\nTo use this, you can either use the model interface, or just the shortcut\nfunction defined in `ticketing.models`. That usage looks like this:\n\n```python\n# Import the function\nfrom ticketing.models import get_ticket\n# Go get yourself a ticket\nticket = get_ticket()\n# Boom. That just happened\n```\n\nThis assumes you've had the single table that needs to be created in the DB,\nin other words, you have run `syncdb` or migrated with e.g. [South][south].\n\n### Multiple Sequences\n\n`django-ticketing` also supports multiple sequences, which allows to have\nsequences of tickets that are independent. This means you could have a sequence\nfor users, a sequence for posts and a sequence for widgets. This is configured\nthrough your Django settings configuration.\n\nSimply define a setting called `TICKETING\\_SEQUENCES` with a tuple of sequence\nnames that have to be valid table names. This defaults to the tuple `('default',)`.\nIn addition, you can define the default sequence from which new tickets are\ntaken from with the setting `TICKETING_DEFAULT_SEQUENCE`, which defaults to\n`'default'`.\n\nNote that `TICKETING_DEFAULT_SEQUENCE` has to be a sequence name that is defined\ninside of `TICKETING\\_SEQUENCES`, otherwise an exception will be raised\nduring setup.\n\nSo to have sequences for the above example, put the following lines in your\n`settings.py`:\n\n``` python\nTICKETING_DEFAULT_SEQUENCE = 'users'\nTICKETING_SEQUENCES = ('users', 'posts', 'widgets', )\n```\n\nThen, to get a ticket from a specific sequence, pass in the sequence name to\n`get_ticket()`:\n\n``` python\n# Get yourself a user ticket\nuser_ticket = get_ticket('users')\n# Get yourself another user ticket\nuser_ticket = get_ticket()\n# Get yourself a posts ticket\npost_ticket = get_ticket('posts')\n```\n\nNotice that the default sequence for `get_ticket()` is the value of the\n`TICKETING_DEFAULT_SEQUENCE` configuration variable.\n\nAlso, after you change the value of `TICKETING_SEQUENCES`, be sure to re-run\n`syncdb` to make sure the new tables are created (or whatever DB table creation\nyou have in your environment).\n\n### Other Configuration Options\n\n`TICKETING_APP_LABEL`: This is used to specify the prefix for all the DB\ntablenames. The default value is `'ticketing'`. Be sure you know what you are\ndoing when you change this.\n\n\n## Testing\n\nThere are some tests included. To run those tests, simply execute `runtests.py`:\n\n``` bash\n[streeter] $ python runtests.py\n----------------------------------------------------------------------\nRan 6 tests in 0.213s\n\nOK\n[streeter] $\n```\n\nThe test suite can run on all DB backends supported by Django. By default\nit runs using sqlite3.\nTo run on MySQL, uncomment the marked section in `runtests.py`, create a\nDB that Django can connect to and give the Django user permissions to\ncreate a new testing DB, e.g. by running the following commands:\n\n``` bash\nmysql -u root -e \"DROP DATABASE ticketing_test\";\nmysql -u root -e \"CREATE DATABASE ticketing_test\";\nmysql -u root -e \"GRANT ALL ON ticketing_test.* TO 'ticketing_test'@'localhost' IDENTIFIED BY ''\"\n```\n\nOf course, you may need to change the host of the DB and user that connects, but\nyou should get the idea.\n\n\n## License\n\nUses the [MIT][mit] license.\n\n\n[flickr]: http://code.flickr.com/blog/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-the-cheap/\n[pypi]: http://pypi.python.org/pypi/django-ticketing/\n[south]: http://south.aeracode.org/\n[mit]: http://opensource.org/licenses/MIT\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreeter%2Fdjango-ticketing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreeter%2Fdjango-ticketing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreeter%2Fdjango-ticketing/lists"}