Changes between Version 6 and Version 7 of CookBookMultiLevelMultiComponentDataModel


Ignore:
Timestamp:
Oct 27, 2005, 1:18:20 AM (19 years ago)
Author:
anonymous
Comment:

Fixed: old model syntax

Legend:

Unmodified
Added
Removed
Modified
  • CookBookMultiLevelMultiComponentDataModel

    v6 v7  
    1010
    1111class Document(meta.Model):
    12     fields = (
    13         meta.CharField('short_name', maxlength=30),
    14         meta.CharField('title', maxlength=100),
    15     )
     12    short_name = meta.CharField(maxlength=30)
     13    title = meta.CharField(maxlength=100)
    1614
    1715    def __repr__(self):
    1816        return self.title
    1917
    20     admin = meta.Admin()
     18    class META:
     19        admin = meta.Admin()
    2120
    2221class Paragraph(meta.Model):
    23     fields = (
    24         meta.ForeignKey(
     22    document = meta.ForeignKey(
    2523            Document,
    2624            edit_inline=True,
    2725            num_in_admin=3,
    28             num_extra_on_change=1
    29         ),
    30         meta.TextField('content'),
    31     )
     26            num_extra_on_change=1 )
     27    content = meta.TextField()
    3228
    3329    def __repr__(self):
Back to Top