for name, label in CUSTOMIZATION_FLAGS:
self.fields[name] = forms.BooleanField(required=False, label=label)
for name, label, choices in CUSTOMIZATION_OPTIONS:
- self.fields[name] = forms.ChoiceField(choices, required=False, label=label)
+ self.fields[name] = forms.ChoiceField(choices=choices, required=False, label=label)
def clean(self):
self.cleaned_data['cust'] = self.customizations
verbose_name = _('picture')
verbose_name_plural = _('pictures')
+ def get_extra_info_json(self):
+ return json.loads(self.extra_info or '{}')
+
def save(self, force_insert=False, force_update=False, **kwargs):
from sortify import sortify
offset -= THUMB_HEIGHT
except KeyError:
pass
- result.append(result_group)
+ if result_group['sponsors']:
+ result.append(result_group)
return result
def render_sprite(self):
'page': self
})
ret = super(SponsorPage, self).save(*args, **kwargs)
- cache.delete('sponsor_page:' + name)
+ cache.delete('sponsor_page:' + self.name)
return ret
def __str__(self):