views:

74

answers:

1

Hi,

I want to get rid of two related managers in a Model because I will never need them. How can I get rid of them?

This is my User Profile:

class UserProfile(models.Model):
    user = models.ForeignKey(User, unique=True)

    ...    

    default_upload_container=models.ForeignKey(Container,related_name='idontcare')
    default_query_container=models.ForeignKey(Container,related_name='idontcareneither')

Because default_upload_container and default_query_container are only user specific defaults I guess I will never query them 'backwards'. I still want easy drop down fields in the admin though.

Thanks for your help.

+4  A: 

I asked about this on the Django mailing list a while back and was told that it's not possible.

I ended up just using a non-sensical naming convention to avoid collisions and try to ignore them.

I agree that it would be nice to say something like related_name=None so you don't have to think about them, but it's one of those things that I've just learned to live with.

Joe Holloway