Skip to content

Instantly share code, notes, and snippets.

View a1tus's full-sized avatar

ILYA a1tus

  • Russia, Moscow
View GitHub Profile
@a1tus
a1tus / admin.py
Created September 5, 2014 00:11
Django 1.7 - DisallowedModelAdminToField
class Inline(admin.TabularInline):
model = B.items.through
class A_Admin(admin.ModelAdmin):
inlines = (Inline,)
class B_Admin(admin.ModelAdmin):
exclude = ('items',)
@a1tus
a1tus / admin.py
Created September 4, 2014 20:27
Django 1.7 - DisallowedModelAdminToField
class VideoRelGenericInline(generic.GenericTabularInline):
model = VideoRel
raw_id_fields = ('video',)
class AnotherModelAdmin(admin.ModelAdmin):
inlines = (VideoRelGenericInline,)
admin.site.register(AnotherModel, AnotherModelAdmin)