Hi All,
I'm currently using a MSSQL DB to access some data and am using django's inspectdb results. I've had to tweak some of the model but so far things have been smooth sailing. Today I needed to run a lookup that spanned through some tables forward and reverse and tested the following in shell which worked fine:
>python manage.py shell
from db_ccmdata.models_auto import TbldataAgentperformancebyperiod as agent_performance
agent_performance.objects.filter(fkagent__tblconfigagentgroupmembers__fkagentgroup__name="IT Call Centre Immediate")
When I implemented this in my code I started getting a FieldError and am confused as hell.
agent_queue = agent_performance.objects.filter(
midnightstartdate__range=(date + ' 00:00:00', date + ' 23:59:59')).filter(fkagent__tblconfigagentgroupmembers__fkagentgroup__name='IT Call Centre Immediate').order_by('fktimeinterval')
I've checked the relationships are all okay but the perplexing thing is that it works in shell as expected.
the relationship is
tbldataagentperformancebyperiod agentfk -> pkey tblconfigagent pkey <- agentfktblconfigagentgroupmembers groupfk -> pkey tblconfiggroup
I'm not sure if it's relevant but doing ./manage.py no longer works and manage.py returns ": No such file or directory" (it's definitely manage.py/python returning this) so I've been calling it with python manage.py etc
Thanks!
What does the FieldError say?--To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4bba252c-1690-4eab-b1e8-62cb674aa151%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/RtlHbhnTfro/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.