Django admin interface deployment

I want to be able to place an inline between two different fields in a set of fields. You can already do this with foreignkeys, I figured that nesting the class I wanted and defining it to get additional forms would do the trick, but apparently I get: "class x" doesn't have a ForeignKey for "class y "
mistake. Isn't that what is supported in Django 1.0? If so, how can I solve the problem if there is no existing solution?

in models.py

class Place(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=80) class Owner(models.Model): name = models.CharField(max_length=100) place = models.ForeignKey(Place) background = models.TextField() license_expiration = models.DateTimeField('license expiration') 

in admin.py

 class PlaceInline(admin.TabularInline): model = Place extra = 5 class OwnerAdmin(admin.ModelAdmin): fieldsets = [ (None, {'fields': ['background','place', 'license_expiration']}), ] inlines = [PlaceInline] 
+6
python django django-admin
source share
1 answer

This doesn't seem to be possible in the Django admin site itself (you shouldn't include inline fields in โ€œfieldsโ€ at all), but you can use JS to move inline fields to where you want.

+3
source share

All Articles