Questions tagged [dynamic-rest]

10 questions
3
votes
0 answers

Filtering in Django Dynamic REST

How can I filter in django dynamic REST (https://github.com/AltSchool/dynamic-rest) with OR clause? I need to implement queryset like User.objects.filter(Q(username="admin") | Q(first_name="test")) Is it possible to do it via request GET query…
Anna
  • 523
  • 3
  • 8
2
votes
2 answers

Django Rest Models ImproperlyConfigured:

I'm trying to use Django ORM where it queries an API rather than a database. I found the library Django Rest Models which does this in conjunction with the library dynamic-rest. My model is called Client, and when I…
1
vote
0 answers

Having a dynamic rest view duplicates the user-list url

(I have a custom user model) I do not understand why this is happening. These are my expected urls: python manage.py show_urls /api/v1/ rest_framework.routers.APIRootView api-root /api/v1/\./ …
blueFast
  • 41,341
  • 63
  • 198
  • 344
1
vote
1 answer

Filter on date range with dynamic rest

I am using django, drf and dynamic rest. I would like to filter on a date range, but there is no documentation for it. How can we specify a date range in the url for dynamic rest?
blueFast
  • 41,341
  • 63
  • 198
  • 344
0
votes
0 answers

Trouble sorting JSON results with django rest framework and dynamic rest

I am trying to sort my results by either date or primary key, newer entries in the database first. models.py class Notifications(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) date = models.DateTimeField('date…
kbessemer
  • 125
  • 1
  • 10
0
votes
1 answer

"How to Add "Nested URL in DRF ,dynamic model viewset"

* i have * router.register(r'reseller/', views.UserViewSet) and router.register(r'one/', views.OneLViewSet) I want to make nested url like 'reseller/ or {pk}/one/ But i'm failed. I tried adding DynamicRelationField to User Model but not…
0
votes
0 answers

Loading related primary keys without PrimaryKeyRelatedField loads too long

To load related primary keys with a serializer it is possible to: use serializers.PrimaryKeyRelatedField(many=True, read_only=True) not define a related Serializer Why does it take more than 20 seconds to load 6 records if I don't define a related…
Tobias Ernst
  • 4,214
  • 1
  • 32
  • 30
0
votes
1 answer

DRF + DREST : how to ensure during tests, the serializer is compiled with the setUp test data?

Using Django: 1.11 Python 3.6 DRF: 3.7 DREST (aka dynamic rest): 1.8 I have a serializer written like this: class SubProjectAsFKWithAttachedFieldsSerializer(DynamicModelSerializer): # attached_fields = AttachedFieldSerializer(embed=True,…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
0
votes
0 answers

Model-less views with dynamic rest

Here is a very good description on how to implement model-less views with django-rest-framework. How can we do the same with the dynamic-rest extension the the django-rest-framework?
blueFast
  • 41,341
  • 63
  • 198
  • 344
0
votes
0 answers

DynamicRelationField not detected

I am using dynamic-rest. According to the documentation, I have this model with a dynamically generated foreign key: class PscSerializer(DynamicModelSerializer): class Meta: model = PSC name = 'psc' fields = ('id',…
blueFast
  • 41,341
  • 63
  • 198
  • 344