2005/10/5, Andy Shaw <[EMAIL PROTECTED]>:
>
> Hi all;
>
> I'm experimenting with subclassing models at the moment. Specifically,
> I'm trying to add an optional element to the user class. The following
> code works fine:
>
> from django.core import meta
> from django.models.auth import User
>
> class MyUser(User):
>         about = meta.TextField(blank=True, default='')
>         class META:
>                 module_name = 'm_users'
>
> ...however, there are already some users in the auth.users table in the
> database. My question is: is there any easy way to get the new class to
> retrieve data from the old table, using the default string to populate
> the /about/ field?
>
> I'm guessing that I could replace the module's get_object() somehow, but
> I don't really want to if I don't have to.
>
> TIA,
>
> -Andy

Hi Andy,
maybe reading the thread "Semantics of subtyping" can be helping you:

http://groups.google.com/group/django-developers/browse_thread/thread/ea5e0bf903058fac

If you can't wait robert working on it, and can't give him a hand,
my best advise is to use a OneToOne realtion instead of subclassing.

HTH,
(c)

--
Carlo C8E Miron, ICQ #26429731
--
Disclaimer:
If I receive a message from you, you are agreeing that:
1. I am by definition, "the intended recipient".
2. All information in the email is mine to do with as I see fit and
 make such financial profit, political mileage, or good joke as it
 lends itself to. In particular, I may quote it on USENET or the WWW.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality that
 may be included on your message.

Reply via email to