Django Ext
Some extensions for Django.
Models
TimestampModel
Add created_at and updated_at for model.
TimeRangeModel
Add started_at and ended_at for model.
UserTrackModel
Add created_by and update_by for model.
This model requires django-currentuser, and should add it to the middleware classes in your settings.py:
MIDDLEWARE = (
...,
'django_currentuser.middleware.ThreadLocalUserMiddleware',
)
ExtraFieldsManager
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.
Usage:
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(user.id) for user in x]) | \
Q(relation__data__groups__contained_by=Group.objects.filter(user__in=x).distinct().values_list('id', flat=True))
})
Commands
translate
Translate the permission names into the local language.
$ python manage.py translate
Metadata
Release files for django-ext 0.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| django_ext-0.12.tar.gz | 6.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_ext-0.12-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / django_ext-0.12.tar.gz
| Download URL | django_ext-0.12.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea8b0b5aa83b28daa7a98873275768fed35d8bdb4783b08ef673bf77752e94d1
|
|
BLAKE2b-256 checksum How to use checksums |
807421c35b1c5adb2a11676e396b7aff7aace88b9b5c2be1e6414fd9a9c9ee02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Release files / django_ext-0.12-py3-none-any.whl
| Download URL | django_ext-0.12-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6fe8a82fef255c4847bf08a17b2e902fc74b13c06f2c8cacd5df8fbb723e114
|
|
BLAKE2b-256 checksum How to use checksums |
fe0dc78dbf41fa181edd6b6e7c888ff41452bee73f53362ac14d741e02079ad0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.14
|
Security for django-ext 0.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.