1 2 3 4 5 6 | def publish(modeladmin,request,queryset):
kwargs = {}
for filter,arg in request.GET.items():
kwargs.update({filter:arg})
queryset = queryset.filter(**kwargs)
queryset.update(published=True)
|
More like this
- Use dateutil's relativedelta to sort an arbitrary list of Django objects by date by cmcavoy 6 years, 2 months ago
- Export Related as JSON Admin Action by johnboxall 3 years, 10 months ago
- Dynamically create Django admin actions by pantsman 3 years, 5 months ago
- Return to a filtered changelist on change form save by richardbolt 2 years, 9 months ago
- Dynamically insert or append a value to an admin option, e.g. list_display or list_filter by frankban 1 year, 8 months ago
Comments