Hey there,
I am trying to figure out how to solve this:
I have created a new model called GroupLevels to extend the already
existing Group model by django.contrib.auth.models.group. I wish to
have the GroupLevels inline with the Group Model in the admin panel. I
have attempted to do this via:
class GroupLevels(models.Model):
group = models.ForeignKey(Group, unique=True)
shows = models.PositiveIntegerField(default=0)
items = models.PositiveIntegerField(default=0)
class Meta:
verbose_name_plural = "Group Permissions"
verbose_name = "Group Permission"
def __unicode__(self):
return
self.group.name
class GroupInline(admin.TabularInline):
model = Group
class GroupAdmin(admin.ModelAdmin):
inlines = [GroupInline,]
admin.site.register(Group, GroupAdmin)
However i get an error saying that there is no foreign key from Group
to GroupLevels. What am i doing wrong here? How do i get them to
display inline in the admin?
Thanks alot for any advice!