best practice stories
This commit is contained in:
parent
068ab66433
commit
b2b512f3be
|
@ -5,12 +5,16 @@ class ImageInline(admin.StackedInline):
|
||||||
model = BestPracticeImage
|
model = BestPracticeImage
|
||||||
extra = 2
|
extra = 2
|
||||||
|
|
||||||
|
class StoryInline(admin.StackedInline):
|
||||||
|
model = BestPracticeStory
|
||||||
|
extra = 3
|
||||||
|
|
||||||
class LinkInline(admin.StackedInline):
|
class LinkInline(admin.StackedInline):
|
||||||
model = BestPracticeLink
|
model = BestPracticeLink
|
||||||
extra = 3
|
extra = 3
|
||||||
|
|
||||||
class BestPracticeAdmin(admin.ModelAdmin):
|
class BestPracticeAdmin(admin.ModelAdmin):
|
||||||
inlines = [ImageInline, LinkInline]
|
inlines = [ImageInline, LinkInline, StoryInline]
|
||||||
list_filter = ['category']
|
list_filter = ['category']
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ class BestPractice(ItfModel):
|
||||||
guideline = models.TextField(blank=True)
|
guideline = models.TextField(blank=True)
|
||||||
guidelines = models.ManyToManyField("Guideline", null=True, blank=True)
|
guidelines = models.ManyToManyField("Guideline", null=True, blank=True)
|
||||||
law = models.TextField(blank=True)
|
law = models.TextField(blank=True)
|
||||||
|
law_image = models.ImageField(upload_to='upload/images/bestpractices/law/', blank=True, null=True)
|
||||||
theatre = models.TextField(blank=True, help_text="Spotlight on Theatre text")
|
theatre = models.TextField(blank=True, help_text="Spotlight on Theatre text")
|
||||||
quick_howto = models.TextField(blank=True)
|
quick_howto = models.TextField(blank=True)
|
||||||
tags = TagField(blank=True, help_text="Enter as many tags as you like, separated by commas.")
|
tags = TagField(blank=True, help_text="Enter as many tags as you like, separated by commas.")
|
||||||
|
@ -65,6 +66,14 @@ class BestPractice(ItfModel):
|
||||||
})
|
})
|
||||||
return images
|
return images
|
||||||
|
|
||||||
|
class BestPracticeStory(models.Model):
|
||||||
|
text = models.TextField()
|
||||||
|
image = models.ImageField(upload_to='upload/images/bestpractices/stories/')
|
||||||
|
bestpractice = models.ForeignKey(BestPractice)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.text
|
||||||
|
|
||||||
|
|
||||||
class BestPracticeCategory(models.Model):
|
class BestPracticeCategory(models.Model):
|
||||||
name = models.CharField(max_length=256)
|
name = models.CharField(max_length=256)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user