Hi,

I have a model which defines a blogger property, which is a OneToOne field
on the django.contrib.auth.models.User model as follows:

class BlogUser(models.Model):
    blogger = models.OneToOneField('auth.User', related_name='blogger')
    url = models.SlugField(max_length=125, unique=True, help_text="URL
automatically generated from the bloggers name.")

When I create an instance of the BlogUser class and access its blogger
property, I get the name of the associated User.
However, in my admin site, the blogger property of the BlogUser object is
displayed as the ID of the associated User object. I suspect that this is
due to lazy-loading of objects by django's querysets
leading to related objects not automatically being loaded? Is it possible to
use a ForeignKey or OneOnOne relationship property as the field from which
to generate a slug? If so, how can it be done?

I would appreciate any advice. Thanks.



Regards,
Sithembewena Lloyd Dube

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

Reply via email to