Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from django.contrib import admin
- from .models import Place
- @admin.register(Place)
- class PlaceAdmin(admin.ModelAdmin):
- list_display = ('name', 'location', 'rating', 'category', 'user')
- list_filter = ('category', 'rating')
- search_fields = ('name', 'location')
- ordering = ('name', '-rating')
- actions = ['custom_action']
- fieldsets = (
- (None, {
- 'fields': ('name', 'description', 'location', 'rating', 'image_url', 'category', 'user')
- }),
- ('Advanced options', {
- 'classes': ('collapse',),
- 'fields': ('field_name',),
- }),
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement