Skip to main content

Django Extensions

Project description

Django Ext

Some extensions for Django.



Add created_at and updated_at for model.


Add started_at and ended_at for model.


Add created_by and update_by for model.

This model requires django-currentuser, and should add it to the middleware classes in your



ExtraFieldsManager is intended to be used in conjunction with ExtraFieldsQuerySet to filter extra added fields using custom filter conditions.

While initializing the ExtraFieldsManager class, it is necessary to use the fields parameter to specify extra fields and their corresponding filter conditions generation functions.


class MyModel(models.Model):
    relation = models.ForeignKey(RelationModel, models.CASCADE, +, null=False)

    objects = ExtraFieldsManager(fields={
        # users: an extra field that is not present in the model
        # lambda function: used to generate complex query conditions
        'users': lambda x: Q(relation__data__users__contained_by=[str( for user in x]) | \
        Q(relation__data__groups__contained_by=Group.objects.filter(user__in=x).distinct().values_list('id', flat=True))



Translate the permission names into the local language.

$ python translate

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ext-0.9.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

django_ext-0.9-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page