how a field and its value can be found in a queryset object
first, I have such an example:
users = Some.objects.filter(user="someone")
based on different user (I have a table to save it), users go to the different databases, and due to Master/Slave seperated, update and filter should be in different places as well). So in line 2, I need to find whether the queryset has a special where field user, and get the db connection based on the user.
My code looks like:
from django.db.models.query import QuerySet
# please let me know how I can get user from self
user = some_way_to_get_user(self)
db = get_db_for_write(user)
self.db = db
My problem lies in the blue part of above code, please let me know how I can achieve this.
I've looked at the code, which might have something like:
Re: how a field and its value can be found in a queryset object
Please ask questions about using Django on django-users. The topic of this list is the development of Django itself.
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.