Hello,

I'm currently rewriting an old Django project (the original was build
on Django 0.95), and I'm trying to rewrite it with the best practice.
My application is centered around a Clubber model which extend the
built-in User model. So the models are currently :

In the clubber app:

class Clubber(models.Model):
    user = models.ForeignKey(User, unique=True)
    avatar = models.ImageField(....)
    [ ... other fields ... ]

In the messagin app:

class InternalMessaging(models.Model):
    from = models.ForeignKey(Clubber)
    to = models.ForeignKey(Clubber)
    content = models.TextField()

It allow me to easily access the clubber avatar from the message with
message_instance.from.avatar, but it had the drawback to force me to
bundle the Clubber app if I would like to re-use the messaging app.

I would like to use the User in the internal message instead of the
Clubber, but now I can't access the avatar field in a good way (with
select_related()). What is the good solution to solve this problem ?

Thanks

-- 
Fabien SCHWOB

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to