In order to be a better metaphor in the common cases, python's
metaclass features are used to do special things with field type
elements.  You will have already noticed that the field attributes of
an *INSTANCE* of a model class are not field objects, or even
properties, but simple attributes.

Generally this is great stuff.  But it means that models are not
standard python classes.  An inheritance hierarchy is one of the
places where the distinction starts to show.  The things that don't
work as you would expect are surprising.  I once went down the rat
hole of the underlying mechanisms enough to be able to inherit
latitude and longitude fields for a group of models that all had a
"location", and thinking about it still makes my head swim.  The
resultant code wasn't particularly readable (maintainable), and I've
decided that in similar cases, it's better to RY (repeat yourself).
Or, depending on what you're doing, a one to one relationship may be a
better choice.

Good luck.

Form classes, by the way, have similar, though seemingly less severe, issues.

Bill

On Thu, May 19, 2011 at 7:21 PM, Valya Golev <m...@valyagolev.net> wrote:
> Hi,
>
> Can anybody please tell me that's the problem with overriding a field from an 
> abstact base model class? It's somewhat against the whole "OOP" thingy and I 
> can't see any technical limitation. What am I missing?
>
> --
> Valya Golev
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to