Re: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
I guess I should apologize myself. To alter how managers return objects the get_query_set method should be overloaded. On 10/15/11, Daniel Roseman wrote: > On Saturday, 15 October 2011 15:12:17 UTC+1, Piotr Hosowicz wrote: >> >> Hello, >> >> I still do not understand

Re: Don't understand still

2011-10-15 Thread Piotr Hosowicz
> Unfortunately, you have received a lot of very bad advice in this thread, > for which I can only apologise on behalf of Django-users ... > > The references to your custom Managers are misleading. Although it's true > that you don't need them, because they're not changing anything, you aren't >

Re: Don't understand still

2011-10-15 Thread Daniel Roseman
On Saturday, 15 October 2011 15:12:17 UTC+1, Piotr Hosowicz wrote: > > Hello, > > I still do not understand how things are connected in Django. In > models.py I have: > > class CampaignManager(models.Manager): > pass > > class CampPeople(models.Model): > person =

Re: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Piotr, You need to remove the custom manager from your code since you are not making use of it. You also need to read the custom manager documentation so you can understand managers and how they work On 10/15/11, Thomas Orozco wrote: > Just don't assign anything to

Re: Don't understand still

2011-10-15 Thread Thomas Orozco
Just don't assign anything to objects and leave that line out of your code ; use the default manager. Le 15 oct. 2011 17:54, "Piotr Hosowicz" a écrit : > On 15 Paź, 17:40, Piotr Hosowicz wrote: > > Carlos, of course I have data in the DB. Babatunde, the

Re: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Yes your context is correct but the problem is with what the context does contain. Managers return querysets but yours does not do anything or return anything. It will be very clear to you if you go to the django in built shell and do PersonPhones.objects.all(). You'll find out that it contains

Re: Don't understand still

2011-10-15 Thread Piotr Hosowicz
On 15 Paź, 17:40, Piotr Hosowicz wrote: > Carlos, of course I have data in the DB. Babatunde, the managers is > the thing that my friend, local Django guru, didn't answer me. I > believe you are right, I just copied the manager with empty body from > previous pieces of code

Re: Don't understand still

2011-10-15 Thread Piotr Hosowicz
Carlos, of course I have data in the DB. Babatunde, the managers is the thing that my friend, local Django guru, didn't answer me. I believe you are right, I just copied the manager with empty body from previous pieces of code that worked. I'll try it, thanks a lot. Regards, Piotr Hosowicz --

Re: Don't understand still

2011-10-15 Thread Piotr Hosowicz
> Models contain code for the ORM and what will be used to create tables > for your database. View is where you can process logic and data from > your models or database  before output to the client. Models are not > directly linked to templates and templates get their context from the > view.

Re: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Hi Piotr, The problem is with your custom managers. You defined PersonPhones manager (and all your other managers) to do nothing and hooked it to objects effectively confusing everything. Ideaally you should have: objects = models.Manager() But in your case its: objects = PersonPhonesManager()

Re: Don't understand still

2011-10-15 Thread Carlos Daniel Ruvalcaba Valenzuela
Also don't forget to load your data in the database, otherwise the results of the query will be empty, you can use the django-admin to help you get started and fill some data in (as outlined on the tutorials from django docs). -- You received this message because you are subscribed to the Google

Re: Don't understand still

2011-10-15 Thread Babatunde Akinyanmi
Hi Piotr, Models contain code for the ORM and what will be used to create tables for your database. View is where you can process logic and data from your models or database before output to the client. Models are not directly linked to templates and templates get their context from the view.

Re: Don't understand still

2011-10-15 Thread Carlos Daniel Ruvalcaba Valenzuela
Perhaps the problem lies on the view code, are you passing the query data to the template? Is que query returning any data? Try posting the relevant code from your views. Regards, Carlos Ruvalcaba El 15/10/2011 14:12, "Piotr Hosowicz" escribió: > Hello, > > I still do not

Don't understand still

2011-10-15 Thread Piotr Hosowicz
Hello, I still do not understand how things are connected in Django. In models.py I have: class CampaignManager(models.Manager): pass class CampPeople(models.Model): person = models.ForeignKey(Person) camp = models.ForeignKey(Campaign) docall = models.BooleanField(True)