Djongo ORM
Project description
Solve the problem of djongo adapting to django orm
- Adaptation issue of decimal128 in mongo and decimalfield in django orm
from djongo_orm.fields import Decimal128Field
class TestModel(models.Model):
decimal_field = Decimal128Field(max_digits=10, decimal_places=2)
- Query issue of boolean in mongo and django orm, and filter issue in rest framework
Model.py
from djongo_orm.fields import BooleanField
class TestModel(models.Model):
boolean_field = BooleanField()
filter.py
from djongo_orm.fields import BooleanField
from django_filters import filters, filterset
class TestFilter1(filterset.FilterSet):
boolean_field = filters.CharFilter(method='filter_boolean_field')
def filter_boolean_field(self, queryset, name, value):
queryset = queryset.filter(boolean_field=value)
return queryset
class Meta:
model = TestModel
fields = ['boolean_field']
class TestFilter2(filterset.FilterSet):
boolean_field = filters.CharFilter(field_name='boolean_field')
class Meta:
model = TestModel
fields = ['boolean_field']
filter_overrides = {
BooleanField: {
'filter_class': filters.CharFilter,
'extra': lambda f: {},
},
}
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
djongo_orm-1.0.2.tar.gz
(3.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file djongo_orm-1.0.2.tar.gz.
File metadata
- Download URL: djongo_orm-1.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd02c6d82f27c55bde552fb62e10db12acc5951ce2a12adac4ee63db557a2de7
|
|
| MD5 |
c5248881110b11a9cc57c1e0f7e87621
|
|
| BLAKE2b-256 |
67fa879e06512d5fd55d11bdaa9260cb818ea63aca55ce8f390c925bfe4abaa7
|
File details
Details for the file djongo_orm-1.0.2-py3-none-any.whl.
File metadata
- Download URL: djongo_orm-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7ff127abb7da8d775aa87bbc9c74cdc6f5b8819f51ef8978b33cf802b592091
|
|
| MD5 |
7490ec186a7d8d005fedd0d79480d516
|
|
| BLAKE2b-256 |
53eb989ecbde275060dbb28ae87c0b0aa1834f0292ea12021dc109a62a501895
|