Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MInor problem with overriding #2

Closed
qrilka opened this issue Feb 13, 2011 · 1 comment
Closed

MInor problem with overriding #2

qrilka opened this issue Feb 13, 2011 · 1 comment

Comments

@qrilka
Copy link

qrilka commented Feb 13, 2011

In my model I've created a field:
site = models.ForeignKey(Site, default=Site.objects.get_current)
This field is set to readonly so I want to create Model items only for the current site. It looks like models.py gets loaded before middleware gets invoked so I get incorrect field value.
Currently I've made a workaround with
site = models.ForeignKey(Site, default=lambda:Site.objects.get_current())
Maybe there is a nicer solution for this problem?

@jaddison
Copy link
Owner

jaddison commented Dec 7, 2012

I believe this is fixed with the merge of #5 by @dannyclark.

@jaddison jaddison closed this as completed Dec 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants