Saturday, August 4, 2012

Re: How to override an attribute?

> https://docs.djangoproject.com/en/1.4/topics/db/models/#field-name-hiding-is-not-permitted

I've already seen this link on stackoverflow.

> Easiest solution to your underlying problem would likely be to find a solution that does not require doing something Django does not support.

Do you have an idea how to do the following without "doing something
Django does not support"?

1. Each class should have the same attribute: a unique name.
For example:
class Foo(): ...
class Bar(Foo): ...

Foo.name should return "Foo"
Bar.name should return "Bar"

2. name should be a field not just a string. (I want to store names in
the database.)


Cheers

--
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.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate