admin.site.register(User, UserAdmin)
class Comic_blockInline(admin.TabularInline):
- model = Comic.blocks.through
- extra = 10
+ model = Comic.blocks.through
+ extra = 10
class ComicAdmin(admin.ModelAdmin):
- fieldsets = [
+ fieldsets = [
(_('Title'), {'fields': ['title']}),
(_('Online'), {'fields': ['is_online']}),
(_('Comic block'), {'fields': ['blocks']}),
]
- inlines = [
+ inlines = [
Comic_blockInline,
]
admin.site.register(Comic_block)
-
+
admin.site.register(Comic)
The default behaviour of class inheritance is to create OnetoOne relationship between parent and child
TODO: Which fields are required to interact with the ads publisher ?
"""
- ADS_PUBLISHER_CHOICES = (
- ('AS', 'Advert Stream'),
- ('TJ', 'Traffic Junky'),
- )
- ads_publisher = models.CharField(max_length=50, choices=ADS_PUBLISHER_CHOICES)
- ads_publisher_login = models.CharField(max_length=50)
+ ADS_PUBLISHER_CHOICES = (
+ ('AS', 'Advert Stream'),
+ ('TJ', 'Traffic Junky'),
+ )
+ ads_publisher = models.CharField(max_length=50, choices=ADS_PUBLISHER_CHOICES)
+ ads_publisher_login = models.CharField(max_length=50)
class Meta:
verbose_name = _('User profile')