On 6 marras, 23:05, Alex Ogier <[email protected]> wrote:
<SNIP>
> ... Since you can't actually override or change the fields of an abstract 
> model anyways (so far as I know?)

Allowing override of abstract parent's fields is fairly trivial
(https://github.com/akaariai/django/compare/abstract_overrides).

I don't immediately see a reason to disallow override of abstract
parent's fields.

Anyways it seems there is some room for improvement in model
validation for abstract parent case:

class Foo(models.Model):
    username = models.CharField(max_length=100)

    class Meta:
        abstract = True

class FooOverride(models.Model):
    username = models.CharField(max_length=200)

    class Meta:
        abstract = True

class Bar(Foo, FooOverride):
    pass

print(Bar._meta.fields)
[<django.db.models.fields.AutoField: id>,
<django.db.models.fields.CharField: username>,
<django.db.models.fields.CharField: username>]

 - Anssi

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

Reply via email to