python - FeinCMS allow a contenttype only once per page object -


is there default action allow contenttype once per page, other overriding admin form? documentation unclear this

i don't think there's out-of-the-box implementation, suggested 1 @ github. since feincms content type abstract django model class use clean method, e.g.

class foocontent(models.model):     content = models.bar('...')      class meta:         abstract = true      def clean(self):         if self.parent.foocontent_set.count() >= 1:             raise validationerror('foocontent allowed once per page.')      def render(self, **kwargs):         return render_to_string('content/foo.html', {             'content': self.content         }) 

this raise non field error on admin form.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -