{"id":14969846,"url":"https://github.com/tushortz/django-simplify","last_synced_at":"2025-10-26T10:31:15.167Z","repository":{"id":57421999,"uuid":"356530331","full_name":"tushortz/django-simplify","owner":"tushortz","description":"Django simplify provides Ruby on Rails-like command line functionalities, models and helper functions so you can focus on development and removes the pain of repeating frequent actions","archived":false,"fork":false,"pushed_at":"2021-05-06T07:51:12.000Z","size":71,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T18:14:43.513Z","etag":null,"topics":["django","helper-functions","pypi-package","python","python3","ruby-on-rails","scaffolder-cli","scaffolding"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/django-simplify","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tushortz.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-10T09:14:07.000Z","updated_at":"2024-09-12T10:05:06.000Z","dependencies_parsed_at":"2022-09-06T05:31:34.125Z","dependency_job_id":null,"html_url":"https://github.com/tushortz/django-simplify","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushortz%2Fdjango-simplify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushortz%2Fdjango-simplify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushortz%2Fdjango-simplify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tushortz%2Fdjango-simplify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tushortz","download_url":"https://codeload.github.com/tushortz/django-simplify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238310305,"owners_count":19450839,"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":["django","helper-functions","pypi-package","python","python3","ruby-on-rails","scaffolder-cli","scaffolding"],"created_at":"2024-09-24T13:42:29.579Z","updated_at":"2025-10-26T10:31:09.678Z","avatar_url":"https://github.com/tushortz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=========================================\nDjango Simplify\n=========================================\n\n\nIntroduction\n=========================================\n\n\nDjango simplify provides Ruby on Rails-like command line functionalities, models and helper functions so you can focus on development and removes the pain of repeating frequent actions.\n\nRequirements\n--------------\n\n* Python `3.6` and above\n* Django (tested with 3.1, probably works with any version that supports\n    Python 3)\n\nInstallation\n---------------\n\n**django-simplify** can be installed via pip.\n\n\n.. code-block:: bash\n\n    $ pip install django-simplify\n\n\nThen just add `simplify` to your `INSTALLED_APPS`.\n\nLearning Resources\n-------------------\n\n- Tutorial videos can be found on this `Youtube playlist \u003chttps://www.youtube.com/playlist?list=PLXg2mG-YST5CG7eFCLBbAH4s4lDqCFRdh\u003e`_.\n- documentation link - https://django-simplify.readthedocs.io\n\nFeatures\n-----------\n\n* timestamp for every model\n* alphabetic filter for admin\n* model, view, template and url route generator\n* automatic import\n\n\nManagement commands\n#########################\n\n**1. create_app**\n\n- automatically adds a `urls.py` file after app is created.\n- adds newly created app in the settings.py file under `INSTALLED_APPS`\n- creates `index`, `edit`, `create` and `detail` view and respective templates\n- adds the app route to your project's `urls.py` file\n\n\nUsage\n###########\n\n.. code-block:: bash\n\n    $ python manage.py create_app \u003capp_name\u003e\n\n\n**2. create_model**\n\nCreates a model and their respective fields. the following types maps to respective Django model fields. It will also add the app to the django admin too.\n\n\n- 121, o2o or set -\u003e OneToOneField\n- bool -\u003e BooleanField\n- date -\u003e DateField\n- datetime or dt -\u003e DateTimeField\n- dict or m2m -\u003e ManyToManyField\n- email -\u003e EmailField\n- file -\u003e FileField\n- list or fk -\u003e ForeignKey\n- float -\u003e FloatField\n- dec -\u003e DecimalField\n- img or image -\u003e ImageField\n- int -\u003e IntegerField\n- str or char -\u003e CharField\n- txt or text -\u003e TextField\n\n\nUsage\n########\n\n.. code-block:: bash\n\n    $ python manage.py create_app \u003capp_name\u003e \u003cmodel_name\u003e field_name:type field_name:type ...\n\n\nan example\n###########\n\n.. code-block:: bash\n\n    $ python manage.py create_app member Member first_name:text last_name:text age:int\n\n\nwill generate the following code in the `member/models.py` file\n\n.. code-block:: python\n\n    class Member(models.Model):\n        first_name = models.CharField(max_length=50)\n        last_name = models.CharField(max_length=50)\n        age = models.IntegerField(default=0)\n\n        created_at = models.DateTimeField(auto_now_add=True)\n        updated_at = models.DateTimeField(auto_now=True)\n\n        def __str__(self):\n            return self.first_name\n\n\n.. note:: The command uses the first specified field as the `__str__` default.\n\n\nSpecifying relationships\n###########################\n\nSpecifying `ForeignKey`, `OneToOneField` or `ManyToManyField` is quite easy. just add an `=\u003crelated_model\u003e`. See example\n\n.. code-block:: bash\n\n    $ python manage.py create_app \u003capp_name\u003e \u003cmodel_name\u003e field_name:type=related_model\n\n    # an example\n    # if the related model is in the same models.py file, specify it as app_name.Model\n    $ python manage.py create_app author Author name:char books:fk=Book # or\n    $ python manage.py create_app author Author name:char books:fk=author.Book\n\n    # if in a different app. (say book model)\n    # obviously you should be able to substitute fk with m2m, o2o, 121\n    $ python manage.py create_app author Author name:char books:fk=book.Book\n\n\nwill create the following\n\n.. code-block:: python\n\n    class Author(models.Model):\n        name = models.CharField(max_length=50)\n        books = models.ForeignKey('book.Book', on_delete=models.CASCADE)\n\n        created_at = models.DateTimeField(auto_now_add=True)\n        updated_at = models.DateTimeField(auto_now=True)\n\n        def __str__(self):\n            return self.name\n\n\n\n**3. create_view**\n\nCreates a view, generate its respective template and adds the path in the urls.py file\n\nUsage\n########\n\n.. code-block:: bash\n\n    $ python manage.py create_view \u003capp_name\u003e \u003cview_name\u003e\n\n\nan example\n###########\n\n.. code-block:: bash\n\n    $ python manage.py create_view member MemberDetail\n\n\n    Helper models\n    ################\n\n    - simplify.utils.TimeBasedModel\n        - Provides the `created_at` and `updated_at` fields for timestamp\n\n    - simplify.utils.NamedTimeBasedModel\n        - Provides the `name`, `created_at` and `updated_at` fields.\n\n    - simplify.utils.AlphaNumericFilterAdmin\n        - when subclassed, it allows the items to be filtered alphabetically by either A-Z or 0-9\n        - **Note**: for this to work, you must specify values for `alphanumeric_filter` in the model admin.\n\n\n    Usage\n    ######\n\n    .. code-block:: python\n\n      # models.py\n      from simplify.utils import TimeBasedModel, NamedTimeBasedModel\n\n      class MyModel(TimeBasedModel):\n          extra_fields = ....\n\n\n\n    .. code-block:: python\n\n      # admin.py\n      from simplify.utils import AlphaNumericFilterAdmin\n\n      class MemberAdmin(AlphaNumericFilterAdmin):\n          alphanumeric_filter = [\"first_name\", \"last_name\", 'age'] # this part is what creates the filter\n          list_filter = ['age']\n          list_display = ['first_name', 'last_name',]\n\n\nTodo\n-----\n\n- add more helper functions\n- add documentation\n\n\n.. note::\n\n    This is still in early development mode. might have bugs. It works fine if you write good code and follow the django style of development. Please fork the project to make contributions\n\n\nAcknowledgements\n================\n\nI'd like to say a big thank you to God without which this wouldn't be possible. I would also like to say thanks to everyone who has and will contribute to this in the future.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushortz%2Fdjango-simplify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftushortz%2Fdjango-simplify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftushortz%2Fdjango-simplify/lists"}