+
+
+def get_topik_image_path(instance, filename):
+ return os.path.join('images', 'topik', instance.page.slug,
+ os.path.basename(filename))
+
+class Topik(models.Model):
+ page = models.ForeignKey('data.Page')
+ image = models.ImageField(_('Image'),
+ upload_to=get_topik_image_path, max_length=250, null=True, blank=True)
+
+ # denormalized from Focus
+ got_focus = models.DateTimeField(default=None, null=True, blank=True)
+ has_focus = models.BooleanField(default=False)