0

Within a fieldset i've added the classes wide and extrapretty like so:

@admin.register(PeerReviewProject)
class PeerReviewProjectAdmin(admin.ModelAdmin):
    date_hierarchy = 'creation_date'
    list_display = ('name', 'creation_date', 'open', 'random', 'deadline')
    inlines = [PeerReviewGroupInline]
    fieldsets = (
        ('Project eigenschappen', {
            'classes': ('extrapretty', 'wide',),
            'fields': ('name', 'open', 'random', 'deadline'),
        }),
        )

But i can't see how this makes any display look different. The admin page looks the same with or without those 2 classes. So what is their use exactly?

2 Answers 2

1

According to Django Documentation : "Two useful classes defined by the default admin site stylesheet are collapse and wide. Fieldsets with the collapse style will be initially collapsed in the admin and replaced with a small “click to expand” link. Fieldsets with the wide style will be given extra horizontal space."

Try to replace extrapetty by collapse on your example and see what's happen.

0

It's not the full answer to your question, but wide is adding an extra space, for sure.

extrapretty might be a way to play around with the CSS in admin. try to go here and check if this will help. It's not in english, but it might give you some idea

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.