Hi Lukasz..
Thanks it was helpful..i was looking for something like this.
-Karan
On Sunday, December 27, 2009 12:50:05 PM UTC-8, Łukasz Balcerzak wrote:
>
> Hi there,
>
> Well, just try to make sure you are passing already saved instance (having
> primary key set)
> into related model which has
Hi there,
Well, just try to make sure you are passing already saved instance (having
primary key set)
into related model which has foreign key to the first one.
Your approach:
> from test.models import A,B
> instA = A()
> instB = B(a=instA)
>
> Now I'm done with my parsing and am happy to save
Ok, not sure why I'm not getting replies, perhaps my problem is too
complex or I'm being too silly with my approach. Either way, I found a
work around by writing a little function to prepare my objects for
saving which ensures that django finds the fkey id's when I issue my save():
def prepare_
Hi guys,
I'm new to Django but otherwise quite a seasoned python and sql
programmer. I'm baffled by django's foreign key id behaviour and as a
result stuck in my current coding project. Let me start immediately
with an example of what I'm trying to do. Assume two very simple
models:
class A(model
4 matches
Mail list logo