class FX models Model name models CharField max_length 24 type models

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
################################################################
class FX(models.Model):
name = models.CharField(max_length = 24)
type = models.CharField(max_length = 3)
time = models.FloatField(default = 0.0)
target = models.CharField(max_length = 16)
class Meta:
db_table = 'effects'
################################################################
class FXAdmin(admin.ModelAdmin):
fieldsets = (
('Primary', {'fields': ('name', 'type')}),
('Secondary', {'fields': ('time', 'target')}),
)
list_display = ('name', 'type')
ordered = ('-name', )
admin.site.register(FX, FXAdmin)
print dir(FX)
print dir(FX._meta.admin)
print dir(FX._meta.admin.fields)