Re: Queries to multiple tables

2012-11-11 Thread Matt Schinckel
Following up: if it affects a single instance of an object, then it belongs as a model method. If it affects any number of them, then it should perhaps go on the manager (or even the queryset: I use django-model-utils PassThroughManager for this a lot). Matt. On Sunday, November 11, 2012

Re: Queries to multiple tables

2012-11-10 Thread Javier Guerra Giraldez
On Sat, Nov 10, 2012 at 6:15 AM, Tomas Ehrlich wrote: > I usualy put methods like this one into Model, although Manager is also > possible. Definitely not View or sth else. definitely in the model. you'd use it like this: accnt = get_object_or_404 (Account,

Re: Queries to multiple tables

2012-11-10 Thread Tomas Ehrlich
Hi Kristofer, I usualy put methods like this one into Model, although Manager is also possible. Definitely not View or sth else. Why I like Model more than Manager is this difference (suppose your method is called make_payment): Account.make_payment # via Model

Queries to multiple tables

2012-11-09 Thread Kristofer
Hello, I'm new to Django and trying to learn it by making a simple budget/checkbook application. I apologize for my ignorance, but I couldn't seem to find an answer to this on Google or the Django docs from my searches. I want to create a function that will take a bank account as an id

Re: SQL Queries over multiple Tables

2007-05-14 Thread Jeremy Dunck
On 5/14/07, James Bennett <[EMAIL PROTECTED]> wrote: > > On 5/14/07, Sven Herzing <[EMAIL PROTECTED]> wrote: > > and I like to get the Products for a specific group and for a specific > > company. > > Given a specific company name and a specific product group name, the > following retrieves all

Re: SQL Queries over multiple Tables

2007-05-14 Thread James Bennett
On 5/14/07, Sven Herzing <[EMAIL PROTECTED]> wrote: > and I like to get the Products for a specific group and for a specific > company. Given a specific company name and a specific product group name, the following retrieves all the products which belong to that company and that group: >>>