38👍
✅
You must use defer
This will not add defined fields to your select
query.
Videos.objects.filter(...).defer('duration')
20👍
You can get all fields first, then pop out the fields you do not want:
fields = Video._meta.get_all_field_names()
fields.remove('id')
Video.object.filter(...).values(*fields)
- Django admin – select reverse foreign key relationships (not create, I want to add available)
- Django-admin.py startproject opens notepad, instead of creating a project
- Django 1.7 removing Add button from inline form
- Installing django 1.5(development version) in virtualenv
- ProgrammingError: relation "django_session" does not exist
Source:stackexchange.com