djangosnippets.org: Latest snippets posted by jackton1https://djangosnippets.org/users/jackton1/2018-05-18T11:42:14.426508-05:00jackton1DRF - Optimizing ModelViewSet queries
2018-05-18T11:42:14.426508-05:00jackton1https://djangosnippets.org/snippets/10647/<p>Using Django REST Framework for Model views there is always the issue of making duplicated queries without either prefetching the objects that will be accessed using the serializer and as such will lead to large number of queries being made to the database.</p>
<p>This will help in optimizing the queryset …</p>
Freely redistributableSupport disabling options in a select widget
2018-04-30T18:44:16.122844-05:00jackton1https://djangosnippets.org/snippets/10646/<p>Provide the ability to disable a select option with Django2. This can be done during the widget initialization (i.e when the widget field is created) or during form initialization.</p>
<p>This will disable the select option based on a context or by specifying the values that should be disabled.</p>
Freely redistributable