Hi,
Need help in generating the sql query i.e generated by django at
runtime from ORM
from django.contrib.auth.models import User
class UserBasicDetails(models.Model):
user_id = models.OneToOneField(User, primary_key=True,
to_field='username')
name = models.CharField(null=False, blank=False, max_length=30)
qs = UserBasicDetails.objects.get
(user_id__email__exact='[email protected]')
I got the below search result qs.query.as_sql()
but, this will generate sql for only for result sets (filter) and not
for a single record/value (get) (UserBasicDetails.objects.filter
(user_id__email__exact='[email protected]'))
Thanks for your time
Regards,
Lokesh
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---