Re: Help me checking this model.. (tb included)

2005-08-23 Thread xtian
On 8/22/05, Brant Harris <[EMAIL PROTECTED]> wrote: > > I agree that it seems odd that Django would, in effect, force it's > ways upon you. But Django has been developed under a philosophy of > adding functionality only if there is a solid use-case for it. So if > you can conjure up a model tha

Re: Help me checking this model.. (tb included)

2005-08-22 Thread Brant Harris
Hrm, well that's sort of how you do it. Take a look at something I have in a model that I am developing: meta.ForeignKey(auth.User, rel_name="manager", related_name="managing", null=True), meta.ManyToManyField(auth.User, rel_name="supervisors",

Re: Help me checking this model.. (tb included)

2005-08-22 Thread xtian
On 8/22/05, Brant Harris <[EMAIL PROTECTED]> wrote: > > > How would this model be implemented in Django? The API provides a > > special case where a recursive relationship back to the current entity > > is denoted by ForeignKey('self'), but for the more general case of a > > circular relationship

Re: Help me checking this model.. (tb included)

2005-08-22 Thread Brant Harris
> How would this model be implemented in Django? The API provides a > special case where a recursive relationship back to the current entity > is denoted by ForeignKey('self'), but for the more general case of a > circular relationship I can't see a way to avoid the NameError. > > I know in SqlOb

Re: Help me checking this model.. (tb included)

2005-08-22 Thread xtian
On 8/22/05, Brant Harris <[EMAIL PROTECTED]> wrote: > > > My question is.. if order matters, is there the possibility, expecially > > in complex models, to reach a "deadlock" condition? > > > > I see where you are headed, though, and the answer is no, it can't > ever happen. You'll notice that

Re: Help me checking this model.. (tb included)

2005-08-22 Thread Brant Harris
> My question is.. if order matters, is there the possibility, expecially > in complex models, to reach a "deadlock" condition? > "Deadlock" really only occurs between processes or threads (http://en.wikipedia.org/wiki/Deadlock). So that is impossible here because your django model is being pro

Re: Help me checking this model.. (tb included)

2005-08-22 Thread paolo
Hi Brant, thanks for your comment. Effectively the model was wrong and your fix has been very useful. This is the working version: from django.core import meta class Ingredient(meta.Model): fields = ( meta.CharField('name', 'Name', maxlength=128), meta.TextField('description'

Re: Help me checking this model.. (tb included)

2005-08-20 Thread Brant Harris
Well I'm not exactly sure what's causing your problem, I have a hunch it has something to do with that to_field option. But regardless, look at your model: Since your Recipie contains the ForeignKey to Intermediary, each of your Recipies can only have one Intermediary, and therefore one Ingredie

Help me checking this model.. (tb included)

2005-08-20 Thread paolo
This is my solution to add to a recipe an arbitrary number of ingredients, each of them with a quantity specified. from django.core import meta class Ingredient(meta.Model): fields = ( meta.CharField('name', 'Name', maxlength=128), meta.TextField('description', 'Description',