Changes between Version 9 and Version 10 of CookBookCategoryDataModel


Ignore:
Timestamp:
Aug 21, 2005, 7:52:21 AM (19 years ago)
Author:
aCC
Comment:

added error message if category is saved in itself.

Legend:

Unmodified
Added
Removed
Modified
  • CookBookCategoryDataModel

    v9 v10  
    3636        return self.get_separator().join(p_list)
    3737    _parents_repr.short_description = "Category parents"
     38
     39    # TODO: Does anybody know a better solution???
     40    def _pre_save(self):
     41        p_list = self._recurse_for_parents(self)
     42        if self.category_name in p_list:
     43            raise "You must not save a category in itself!"
    3844
    3945    def __repr__(self):
Back to Top