Changes between Version 10 and Version 11 of CookBookCategoryDataModel
- Timestamp:
- Sep 25, 2005, 12:40:37 PM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CookBookCategoryDataModel
v10 v11 9 9 {{{ 10 10 class Category(meta.Model): 11 verbose_name_plural = 'Categories' 12 module_name = verbose_name_plural.lower() 13 fields = ( 14 meta.CharField('category_name', maxlength=50), 15 meta.ForeignKey('self', blank=True, null=True, 16 rel_name='parent', related_name='child'), 17 meta.ForeignKey(User) 18 ) 11 category_name = meta.CharField(maxlength=50) 12 parent = meta.ForeignKey('self', blank=True, null=True, 13 related_name='child') 19 14 20 15 def _recurse_for_parents(self, cat_obj): … … 48 43 return self.get_separator().join(p_list) 49 44 50 admin = meta.Admin( 51 list_display = ('category_name', '_parents_repr'), 52 search_fields = ['category_name'], 53 ) 45 class META: 46 admin = meta.Admin( 47 list_display = ('category_name', '_parents_repr'), 48 search_fields = ['category_name'], 49 ) 50 module_name = 'categories' 54 51 }}} 55 52 … … 107 104 {{{ 108 105 class Document(meta.Model): 109 fields = ( 110 meta.CharField('title', maxlength=200), 111 meta.ForeignKey(Category, name='subject', blank=True, null=True), 112 ... 106 title = meta.CharField('title', maxlength=200), 107 subject = meta.ForeignKey(Category, blank=True, null=True), 108 ... 113 109 }}} 114 110