Saravanan666/pypi-org huggingface dataset:
Package: django-model-publisher-ai
Django model mixins and utilities for a standard publisher workflow.This is a fork ofdjango-model-publisher.django-model-publisher-aisupportsDjango1.8 through 1.11 (latest bugfix
release in each series only) on Python 2.7, 3.3 (Django 1.8 only), 3.4, and 3.5.This app is available onPyPI.Getting HelpDocumentation for django-model-publisher is available athttps://django-model-publisher.readthedocs.org.QuickstartInstall django-model-publisher-ai:pip installdjango-model-publisher-aiFeaturesDjango CMS placeholders support.Hvad/Parler support.Restrict user access to publish functions with user permissions.
Package: django-model-publisher-mj
Django model mixins and utilities for a standard publisher workflow.This is a fork ofdjango-model-publisher.django-model-publisher-aisupportsDjango1.8 through 1.11 (latest bugfix
release in each series only) on Python 2.7, 3.3 (Django 1.8 only), 3.4, and 3.5.This app is available onPyPI.Getting HelpDocumentation for django-model-publisher is available athttps://django-model-publisher.readthedocs.org.QuickstartInstall django-model-publisher-ai:pip installdjango-model-publisher-aiFeaturesDjango CMS placeholders support.Hvad/Parler support.Restrict user access to publish functions with user permissions.
Package: django-modelqueryform
django-modelqueryformis a flexible app that helps you build Q object generating forms.It is a great tool if you want you users to be able to do filtered searches against your models.ProjectThe project can be found athttps://github.com/ckirby/django-modelqueryformDocumentationThe full documentation is athttps://django-modelqueryform.readthedocs.org.RequirementsDjango 1.11+Python 3.4+FeaturesUseable default FormFields for ModelFields that:Have.choicesdefined or are inherently made of choices (ie.BooleanFieldandNullBooleanField)Are represented as numeric types (eg.IntegerField,FloatField, etc.)Text backed fields need code written to handle them. That is easy though, because:Creation of FormFields, Q objects, and User readable query terms are completely customizable. You can target ModelFields:By name (If the field has specific requirements)By field type (Use the same widget or Q object builder for allCharFields)Can follow Model relationships or treat relationship fields as.choicesProvides a new Field and Widget (RangeField,RangeWidget). These allow users to generate a__gte,__ltepair for the orm, optionally also including an__isnullRangeFieldDynamically generates min and max boundaries. (AggregateMinandMaxon the model field)Ifnull=Trueon the ModelField allows user to indicate if they want to include null values in the queryRangeWidgetReturns aMultiWidgetwith 2NumberInputwidgets (with min and max attributes)
Package: django-model-reference
``django-model-reference`` defines a simple :cls:`model_reference.Reference`model that hold named references to specific instances of any Django model.Usage=====References are controlled by the :func:`register()` and :func:`load` functions ofthe ``model_reference`` module. These function are also mirrored by thecorresponding methods in the ``Reference.objects`` manager. To register areference, simply pass the object and either a unique name or a unique suffix::from model_reference import register, loadfrom django.contrib.auth.models import User# Fetch some objectsjohn = User.objects.get(username='john')ringo = User.objects.get(username='ringo')# Register references in the databaseregister(john, 'favorite beatle')register(ringo, suffix='drummer')The name for each reference is unique. If the register function is called withthe explicit ``suffix`` argument, it will register the instance as``<app_label>.<model>:suffix``, which in our case becomes ``'auth.user:drummer'``.In order to retrieve the objects referred by the Reference object, we can usethe :func:`load` function::>>> load('favorite beatle')<User: john>>>> load('drummer', model=User)<User: ringo>Objects registered with the suffix form of the register function should pass amodel class in order to construct the complete name string. This is equivalentas creating the string by hand:>>> load('auth.user:drummer')<User: ringo>Empty references================If one request a non-existing reference to the load() function, it raises an:error:`model_reference.EmptyReferenceError`. Users can register factoryfunctions to create these objects on-the-fly.The default way of registering factory function is via the :func:`model_reference.factory`decorator. It must be called with a reference string (or suffix + model) anddecorates a function that return a new instance and is called without arguments::@factory('drummer', model=User)def make_ringo():user, created = User.object.get_or_create(username=ringo,first_name='Richard'last_name='Starkley',email='ringo@applerecords.co.uk')return userIf a new instance is created, the function is responsible to save it in thedatabase
Package: django-model-report
Django Model Report===================django-model-report is a Django application and library for reports integrated with highcharts.[![Build Status](https://travis-ci.org/juanpex/django-model-report.png)](https://travis-ci.org/juanpex/django-model-report)Demo====http://django-model-report.herokuapp.comDocumentation=============https://django-model-report.readthedocs.org/en/latest/ForeignKey queryset in main report.py file:list_filter_queryset = {'user': {'groups__in': [13, 34]},}Custom widget:list_filter_widget = {'state':  SelectMultiple(),}Contribute==========Clone the repo and help to be better this app :)[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/juanpex/django-model-report/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
Package: django-model-report-fork
Django Model Report===================django-model-report is a Django application and library for reports integrated with highcharts.[![Build Status](https://travis-ci.org/juanpex/django-model-report.png)](https://travis-ci.org/juanpex/django-model-report)now maintained by  [@jelenak](https://github.com/jelenak "@jelenak")--------------------------------------------------------------------Demo====http://django-model-report.herokuapp.comDocumentation=============https://django-model-report.readthedocs.org/en/latest/ForeignKey queryset in main report.py file:list_filter_queryset = {'user': {'groups__in': [13, 34]},}Custom widget:list_filter_widget = {'state':  SelectMultiple(),}Contribute==========Clone the repo and help to be better this app :)[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/juanpex/django-model-report/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
Package: django-model-revisioning
Add history to your models - migrations compatible!Supported versionsPython 3.6, 3.7, (3.8 soon)Django 2.2.x, 3.0.xCurrent statedjango-model-revisioning is currently not production ready - we need more tests for that!You can install the pre-release from PyPI though using:$ pip install django-model-revisioning
Package: django-models
Para visualizar o README em português.Django Models is Library with several useful Models for Django to help you make your templates smart or with less codeRequirementsPython 3.xDjango 1.11 or laterFeaturesGeneric ModelsActiveModelModel with is_active boolean fieldCodeModelModel with a code field that automatically generates a hash of 16 characters by default. Useful to identify your record in a more humane waySerializerModelModel to return a dict with all data of your django instance without a serializer.Example:Your Modelfromdjango_models.modelsimportSerializerModel...classYourModel(SerializerModel)name=models.CharField(max_length=255)...UsageIn[1]:from.importYourModelIn[2]:instance=YourModel.objects.first()In[3]:user.serialize()Out[3]:{'id':1,'name':'first record',...}SlugModelModel with a slug field. Useful to use in urls or nominal referencesTimestampedModelModel with the DateTime, created_at and updated_at fields. Useful to control when any changes were made.UUIDModelModel that uses the id field as a UUID. Useful to be able to have a unique identifier without worrying about sequences.History modelsHistory Model
Model that track each save to generate a History Changes of a recordSignals ModelsWith SignalModel it allows you to handle or execute an event according to Django’s Signals.On Save:pre_save (Before Saving)post_save (After saving)On Erase:pre_delete (Before Erasing)post_delete (After Deleting)Example using Pre-save signalNote: This will be made before you save your modelfromdjango_models.modelsimportSignalsModel...classYourModel(SignalsModel)...defpre_save(self):do_something()Soft Delete Signal ModelSoftDeleteSignalModel ModelsIt is the SignalsModel with soft delete implemented. Allows nothing you delete to be really deleted from the system and easy to recoverHow to installGetting ItYou can get Django Models by using pip:$pipinstalldjango-modelsIf you want to install it from source, grab the git repository from GitHub and run setup.py:$gitclonegit@github.com:rhenter/django_models.git$cddjango_models$pythonsetup.pyinstallSettingsTo enabledjango_modelsin your project you need to add it toINSTALLED_APPSin your projectssettings.pyfile:INSTALLED_APPS=(...'django_models',...)DocumentationCheck out the latestdjango-modelsdocumentation atGitHub PagesContributingPlease send pull requests, very much appreciated.Fork therepositoryon GitHub.Make a branch off of master and commit your changes to it.Install requirements.pip install-rrequirements-dev.txtInstall pre-commit.pre-commitinstallRun the tests withcdtest-django-project;py.test-vv-sCreate a Pull Request with your contribution
Package: django-models2puml
Django models2pumlDjango models to PlantUML is a Django application which provides a management command to generate
a PlantUML class diagram based on the install apps Django models.
For more information about the PlantUML tool and text formathttps://plantuml.comInstallation & usageto use the application first you need to install it in your environment using pip:pip install django-models2pumlAdd the application to your settings INSTALLED_APPS:INSTALLED_APPS = [
        ...
        'models2puml',
    ]Use the newly available management command using manage.py./manage.py generatepuml --apps <Installed app name(s)>The output of the command is a plantUML text description of a class diagram of your installed apps modelsToDoAdd class relationshipsAdd the option to output the text to a fileClean up the codeAdd test coverageAdd the option to generate the diagram as an image (Not sure if this is appropriate here, will only add this option if convinced it's worth the added dependencies)
Package: django-modelsdoc
Create models definitions document from your django project. This project help the documentation related to Django models.Quick startAdd “modelsdoc” to your INSTALLED_APPS setting like thisINSTALLED_APPS = (
    ...
    'modelsdoc',
)Runpython manage.py listing_modelsto listing model definitionYou can seethe resultsof executing the command totests/models.py.Option–app(-a)You can pass specify app name. Listing only the specified app.$ python manage.py listing_models --app polls–output(-o)It writes the results to the specified file.$ python manage.py listing_models --output sample.rst–format(-f)You can choice output format.rst(reStructuredText) ormd(Markdown). Default format isrst.$ python manage.py listing_models --format mdCustomize SettingsMODELSDOC_APPSYou can specify the apps and change the order.# output only models of poll
MODELSDOC_APPS = (polls,)MODELSDOC_DISPLAY_FIELDSYou can specify the field value and change the order.MODELSDOC_DISPLAY_FIELDS = (
    ('Fullname', 'verbose_name'),
    ('Name', 'name'),
    ('Type', 'db_type'),
    ('PK', 'primary_key'),
    ('Unique', 'unique'),
    ('Index', 'db_index'),
    ('Null/Blank', 'null_blank'),
    ('Comment', 'comment'),
)MODELSDOC_MODEL_OPTIONS# TODO more documentedMODELSDOC_MODEL_OPTIONS = (
    'unique_together',
    'index_together',
    'ordering',
    'permissions',
    'get_latest_by',
    'order_with_respect_to',
    'db_tablespace',
    'abstract',
    'swappable',
    'select_on_save',
    'default_permissions',
    'default_related_name'
)Other settings# TODO more documentedMODELSDOC_OUTPUT_TEMPLATE = 'modelsdoc/models'
MODELSDOC_OUTPUT_FORMAT = 'rst' # default format
MODELSDOC_MODEL_WRAPPER = 'modelsdoc.wrappers.ModelWrapper'
MODELSDOC_FIELD_WRAPPER = 'modelsdoc.wrappers.FieldWrapper'
MODELSDOC_INCLUDE_AUTO_CREATED = TruePython and Django SupportDjango.1.5Django1.6Django1.7Django1.8Django1.9Django1.10Django1.11Django2.0Python 2.7◯◯◯◯◯◯◯PyPy◯◯◯◯◯◯◯Python 3.3◯◯Python 3.4◯◯◯◯◯◯Python 3.5◯◯◯◯◯Python 3.6◯◯◯◯◯LicenseMIT Licence. See the LICENSE file for specific terms.Authorstell-kwanshotHistory0.1.11(Nov 28, 2019)Add models.yaml template file.0.1.10(Nov 28, 2019)Add Support YAML format.0.1.9(Feb 8, 2018)FixSet section length dynamically. Thanks to wanshot0.1.8(Dec 3, 2017)Add Support Django2.00.1.7(May 29, 2017)Add Support Django1.11 and Python 3.60.1.6(Nov 4, 2016)Add Support Django1.100.1.5(May 4, 2016)Add Support Python3.5 and Django1.90.1.4(Sep 23, 2015)Fixed bug. When print models, linebreak is ignored.Add ManyToManyField’s info on “listing_models” results.0.1.3(Jul 19, 2015)Fixed bug. install test code.Add new option “MODELSDOC_INCLUDE_AUTO_CREATED”0.1.2(Jun 21, 2015)Bug fixed. Not include output templates.0.1.0(Jun 21, 2015)First release
Package: django-models-ext
django-models-extensionsDjango Models ExtensionsInstallationpipinstalldjango-models-extUsagefromdjango_models_extimportBaseModelMixin,upload_path,upload_file_urlclassMyModel(BaseModelMixin):upload=models.FileField(upload_to=upload_path)@propertydefupload_url(self):returnupload_file_url(self.upload)
Package: django-models-extensions
InstallingYou can install or upgrade django-models-extensions with:$pipinstalldjango-models-extensions--upgradeOr you can install from source with:$gitclonehttps://github.com/lampofearth/django-models-extensions--recursive$cddjango-models-extensions$pythonsetup.pyinstallShort descriptionVirtualFunctionField- Creates a virtual field that contains the calculated function for the fields of the current modelQuerysetExtension- Extension of the classic QuerySet Manageras_dictas_dfAdminButtonMixin- Convenient creation of additional buttons in the admin panelExamplesdjango-models-extensionsexamples lives atgithub.com/lampofearth/django-models-extensions/wiki.LicenseYou may copy, distribute and modify the software provided that modifications
are described and licensed for free underLGPL-3.
Derivatives works (including modifications or anything statically linked to the library)
can only be redistributed under LGPL-3, but applications that us
Package: django-model-snapshot-diff
Django model snapshot differenceMake snapshot from Django model with all deep relations and get differenceExample models with other relations like OneToOne, ManyToMany etc.:fromdjango.dbimportmodelsfromdjango_model_snapshot_diff.mixinsimportSnapshotMixinfromdjango_model_snapshot_diff.modelsimportSnapshotModelclassManyToMany(SnapshotMixin,models.Model):description=models.CharField(max_length=255)snapshot_fields=[('description','ManyToMany DESCRIPTION field'),]classForeignKeyDeeper(SnapshotMixin,models.Model):name=models.CharField(max_length=255)many_to_many=models.ManyToManyField('example.ManyToMany')snapshot_fields=[('name','ForeignKeyDeeper NAME field'),('many_to_many','ForeignKeyDeeper MANYTOMANY field'),]classForeignKey(SnapshotMixin,models.Model):title=models.CharField(max_length=255)foreign_key_deeper=models.ForeignKey('example.ForeignKeyDeeper',on_delete=models.CASCADE)snapshot_fields=[('title','ForeignKey TITLE field'),('foreign_key_deeper','ForeignKey DEEPER field'),]classRelation(SnapshotMixin,models.Model):choice=models.CharField(choices=((1,'A'),(2,'B')),default=1,max_length=2)rel_to_example=models.ForeignKey('example.Example',on_delete=models.CASCADE,related_name='relation_to_example')snapshot_fields=[('choice','Relation CHOICE field'),]classExample(SnapshotModel):text=models.CharField(max_length=255)boolean=models.BooleanField(default=False)datetime=models.DateTimeField(auto_now=True)foreign_key=models.ForeignKey('example.ForeignKey',on_delete=models.CASCADE)snapshot_fields=[('text','Example TEXT field'),('boolean','Example BOOL field'),('datetime','Example DATETIME field'),('foreign_key','Example ForeignKey field'),('relation_to_example','Example Relation field'),]snapshot_fields should be a list of tuples with fields to track, for example:snapshot_fields=[('model_field_name','Verbose name, any text')]How to use?example=Example.objects.first()example.save_snapshot()example.text='new text'example.save()diff=example.diff(verbose=True)assertdiff=={'Example TEXT field':{'New Value:':'new text','Old Value':'text'}}Diff will contain all difference with relations, for full example look for a tests.TestingTests are found in a simplified Django project in the/testappfolder. Install the project requirements and do./manage.py testto run them.LicenseSeeLicense.
Package: django-model-stats
django-model-statsDisplay how often models and model fields are used in the database.InstallationAdd'model_stats'to yourINSTALLED_APPSAddpath('admin/stats/', include('model_stats.urls'))to yoururlpatterns. Make sure it’s includedbeforethe'admin/'entry, so
that requests to/admin/stats/don’t get handled by the latter entry.FeaturesAllows you to find models or fields that are rearly usedNo additional user tracking, only uses the data that is already availableNo external dependencies
Package: django-model-to-dict
Django Model to Python dict serialization mixin.Based on the original gist:https://gist.github.com/gbezyuk/de29d4888818b87f8addd8143b5331e0RequirementsCurrently the package is tested with Python3 and Django 1.10 only.DocumentationThe full documentation is athttps://django-model-to-dict.readthedocs.io.QuickstartInstall Django-Model-To-Dict:pip install django-model-to-dictAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_model_to_dict.apps.DjangoModelToDictConfig',# or just 'django_model_to_dict'...)UseToDictMixinwith your model:fromdjango_model_to_dict.mixinsimportToDictMixinfromdjango.dbimportmodelsclassYourModel(models.Model,ToDictMixin):passSince now you model’s instances have theto_dictmethod defined.You can setup additional settings both in your global project configuration or in a particular model.
See docs for more details.FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2016-12-15)First release on PyPI.
Package: django-model-to-excel
Simple Excel File Generator From Django Model.Required Packages:pip install pandasUsage :from django_model_to_excel import generate_excel_file

def fun(request):
    queryset = User.objects.all().values()
    # all_to_excel accepts six parameter
    # queryset will be your model data
    # file_path : 'your absloute path' or None if it is None fill will store in your project Base Directory
    # file_name : 'string' or None
    # sheet_name : 'string' or None
    # index and header : Boolean
    generate_excel = generate_excel_file.all_to_excel(queryset, file_path, file_name, sheet_name, index, header)
Package: django-model-to-excel-csv
Simple Excel and CSV File Generator From Django Model.Required Packages:pip install pandasUsage :Django Models to Excel File:from django_model_to_excel_csv import generate_excel_file

def func(request):
    queryset = User.objects.all().values()
    # queryset will be your model data
    # file_path : 'your absloute path' or it will store in your project Base Directory
    # file_name accepts string : 'string' 
    # sheet_name accepts string : 'string'
    # index and header : Boolean
    generate_excel = generate_excel_file.all_to_excel(queryset, file_path, file_name, sheet_name, index, header)Django Models to CSV File:from django_model_to_excel_csv import generate_csv_file

def func(request):
    queryset = User.objects.all().values()
    # queryset will be your model data
    # file_path : 'your absloute path' or it will store in your project Base Directory
    # file_name accepts string : 'string' 
    # sheet_name accepts string : 'string'
    # index and header : Boolean
    generate_excel = generate_excel_file.all_to_excel(queryset, file_path, file_name, sheet_name, index, header)
Package: django-modeltools
Installationpip installdjango-modeltoolsIncluded ToolsEnumTheEnumclass lets you quickly define enumeration types for model field values. The constructor accepts kwargs where the key is the name of the “constant” and the value is a two-tuple containing the value of the constant (which will be stored in the database) and a label.UsageIn models.py:frommodeltoolsimportEnumclassMyModel(models.Model):Color=Enum(RED=('r','Red'),GREEN=('g','Green'),BLUE=('b','Blue'),)color=models.CharField(max_length=1,choices=Color.choices())Elsewhere:m=MyModel.objects.filter(color=MyModel.Color.RED)format_filenameTheformat_filenamefunction provides an easy way to name user media (uploaded files) based on properties of the model that stores them.UsageIn models.py:frommodeltoolsimportformat_filenameas_ffclassPerson(models.Model):first_name=models.CharField(max_length=50)last_name=models.CharField(max_length=50)middle_name=models.CharField(max_length=50)avatar=models.ImageField(upload_to=_ff('avatars/{last_name}_{first_name}'))In the above example,{first_name}and{last_name}will be replaced with the corresponding values from thePersoninstance. The uploaded file will automatically retain its original extension.upload_to=_ff('avatars/{last_name}_{first_name}/{__filename}.thumbnail{__ext}'){__filename}and{__ext}allows access to the name and extension the file was uploaded with.By default, the properties used in the formatting pattern will be converted to lowercase, stripped of non-word characters, and have their spaces replaced with underscores. (This behavior can be changed by providing extra arguments to theformat_filenamefunction.) The rest of the formatting string will be unaffected.