Tuesday, September 25, 2012

Re: Inheritance and default value

Hi winniehell,
I think this will help you.
Dummy
.__dict__.update({"myfield":42})

regards
--Laxmikant Gurnalkar


On Tue, Sep 25, 2012 at 4:17 PM, winniehell <django@winniehell.de> wrote:
Hello list!

I try to overwrite a default value of a field in a subclass of an
abstract model. This is how I do it currently:
https://gist.github.com/3781124

Is there any better way? As far as I know the _meta-class API is subject
to change.

Just to be clear about that: I can not move myfield out of the Base
class as there are multiple classes inheriting from it.

Best regards,
Winnie

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.




--
GlxGuru

--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment