Ok let's start from the very beginning because this MVC business is making me juggle too many balls all at once. More than I can handle and understand.
### PART A.1 With this Filter 5 view code I get the list result that I expect. But it is not ordered the way I want. class AltwordlistView(generic.DetailView): model = Word template_name = 'navi_polls/altword_list.html' context_object_name = 'poll' def get_queryset(self): # Filter 5 return *Word.objects.filter(direct_transl_word='')* * * * * ### PART A.2 - *Detail page* <h1>Page</h1> Filter 5 * Page - Leafy 2 = 18 votes * Page - Leafy 3 = 50 votes ### PART B.1 So when I want to simulate and test different querys in Python shell then I'm having trouble simulating the above query syntax. This is as far as I'm able to simulate Filter 5 in shell. How can I proceed further with this simulation? >>> from navi_polls.models import Word, Altword >>> >>> Word.objects.filter(direct_transl_word='') [<Word: Page>, <Word: Paper>, <Word: Beetlejuice?>] >>> >>> p = Word.objects.get(pk=1) >>> p <Word: Page> ### PART B.2 - *Filter 5 simulation errors* >>> p <Word: Page> >>> >>> p.Word.objects.filter(direct_transl_word='') Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'Word' object has no attribute 'Word' >>> >>> >>> >>> p.objects.filter(direct_transl_word='') Traceback (most recent call last): File "<console>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/django/db/models/manager.py", line 232, in __get__ raise AttributeError("Manager isn't accessible via %s instances" % type.__name__) AttributeError: Manager isn't accessible via Word instances >>> >>> >>> >>> p.filter(direct_transl_word='') Traceback (most recent call last): File "<console>", line 1, in <module> AttributeError: 'Word' object has no attribute 'filter' >>> On Tuesday, August 20, 2013 12:30:54 PM UTC+2, Daniel Roseman wrote: > > On Tuesday, 20 August 2013 11:25:02 UTC+1, Pepsodent Cola wrote: > >> >> But the above Detail list initially works by a 1-to-Many relationship. >> When I add my 1-to-1 relationship in order to connect the votes field to >> Word table then I get a bunch of weird MVC conflicts that I don't >> understand. So it makes me think that you cannot have 1-to-Many and 1-to-1 >> in the same table (Altword), is that True or False? >> > > That is *false*. > > But you need to *tell us what the problems are*. There's no point saying > "the database doesn't do what I wish for" or "I get weird conflicts". You > need to show exactly what is happening: what you tried, what you expected, > what you actually got, and post the actual error message and traceback. > -- > DR. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. For more options, visit https://groups.google.com/groups/opt_out.