You can use events = venue.event_set
to go the other way.
Note that venue.event_set
is a manager object, like Event.objects
, so you can call .all
, .filter
, .exclude
and similar on it to get a queryset.
See the Django documentation
More Related Contents:
- Using request.user with Django ModelForm
- How to change the file name of an uploaded file in Django?
- Django – form.save() is not creating ModelForm
- django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. plz help me out plz
- How do I filter ForeignKey choices in a Django ModelForm?
- dynamically add field to a form
- Django Passing Custom Form Parameters to Formset
- Django: multiple models in one template using forms [closed]
- Django ModelForm for Many-to-Many fields
- Multiple Models in a single django ModelForm?
- Define css class in django Forms
- How to set up custom middleware in Django
- Django: CSRF token missing or incorrect
- Change Django ModelChoiceField to show users’ full names rather than usernames
- ValueError: Missing staticfiles manifest entry for ‘favicon.ico’
- Django: adding an “Add new” button for a ForeignKey in a ModelForm
- What’s the best way to store a phone number in Django models?
- Class has no objects member
- Customize/remove Django select box blank option
- How to expire Django session in 5minutes?
- Pre-populate an inline FormSet?
- Class Based Views VS Function Based Views
- Django 1.11 TypeError context must be a dict rather than Context
- Override a form in Django admin
- Django Passing data between views
- QuerySet, Object has no attribute id – Django
- How do I filter values in a Django form using ModelForm?
- Change a Django form field to a hidden field
- Django DoesNotExist
- Django — Conditional Login Redirect