My fear is that it hides the fields that the FirstCategorizedContent
model has. Looking at the models.py file gives me no insight into
what fields the model has. Therefore the code is implicit instead of
explicit. I would have to memorized the fields ContentBase and
CategoriesMixIn to know what fields the FirstCategorizedContent model
has or have to dig into the base model and mixin models.py's to find
out.
As far as the mix-ins go, I see them being handy for 90% of the
models. There will be fringe cases where the default field attributes
won't wanted and we'll need not use a mixin. For instance the
CategoriesMixIn has the field:
categories = models.ManyToManyField(Category, blank=True, null=True)
If we wanted to make the categories required we'd have to not use the
CategoriesMixIn. Not a big deal really, unless there is code checking
if a model inherits CategoriesMixIn. It would ignore that model.
Probably an argument against inheritance checking and for duck
typing. As long as the model follows the same interface template
(i.e. using the field name categories), the code can use duck typing
to assume the model's categories are stored there.
Even if the MixIn's aren't used to build a model, they provide a
template for models that don't use them. If someone writes a model
that deviates from the template they better have a good reason for it
otherwise they'll have to fix it.
We'll see how things go. That's all we can do. Implement and cross
our fingers :)
On May 28, 7:36 am, Michael <
newmani...@gmail.com> wrote:
> On Wed, May 27, 2009 at 2:07 PM, Eric Moritz <
eric.mor...@gmail.com> wrote:
>
> > I started working on the category app and after implementing a sample
> > content object I started thinking that basecontent violates a number
> > of the PEP 20 rules,
http://www.python.org/dev/peps/pep-0020/