use filedsets can dispaly them in that way , but it looks differently

from django.contrib import admin
from models import *

class BarAdmin(admin.ModelAdmin):
    fieldsets = [
        (None, {
            'classes': ('field3',),
            'fields': ['field3']
        }),
        (None, {
            'classes': ('field2',),
            'fields': ['field2']
        }),
        (None, {
            'classes': ('field1',),
            'fields': ['field1']
        }),
    ]

admin.site.register(Bar,BarAdmin)

On 5月20日, 下午6时27分, Dirk Eschler <esch...@gmail.com> wrote:
> Hello,
>
> is there an easy way to reorder field display in a tabular admin inline, like
> fieldsets for common admin forms?
>
> Consider the following models, with Bar being edited inline:
>
> class Foo(models.Model):
>     field1 = models.CharField(max_length=255)
>     field2 = models.CharField(max_length=255)
>     class Meta:
>         abstract = True
>
> class Bar(Foo):
>     field3 = models.CharField(max_length=255)
>
> This will result in an display order of [field1, field2, field3], while i want
> it be ordered like [field3, field1, field2] or [field3, field2, field1]. Since
> Foo is abstract, i can't just swap the definition order to achieve this.
>
> Best Regards,
> Dirk Eschler
>
> --
> Dirk Eschler <esch...@gmail.com>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to