Am Dienstag, 23. September 2008 16:43:38 schrieb Ed Leafe:
> On Sep 23, 2008, at 9:29 AM, Sibylle Koczian wrote:
> > newrec =  False
> > diff =  {'idn': (u'', u'AC2'), 'amount': (None, Decimal("345.6"))}
>
>       Wow, thanks for all the information! That makes it a lot easier to
> figure out what's going on.
>
>       I've quoted the above because it showed me what the problem is. Note
> that even though this is a new record, 'newrec' is False. Digging into
> the code, the problem is because of the system we use to track new
> records: we store the PKs of new records as dictionary keys to later
> on identify them. In your case, the default value of the PK in the new
> record (i.e., "") was stored as the key. Later on, when you tried to
> save, the PK value was 'AC2'; since this value was not in the keys of
> new records, the code assumed it was not new, and thus did not try to
> save the PK. This also explains the one traceback you got: that was
> the result of trying to move to the record whose PK was the empty
> string, since that's what the new records dictionary had saved.
>

Thank you, now I understand what happens.

>       I need to spend a bit of time to figure out the best way to correct
> this problem, but right now I'm at work and won't be able to focus on
> this until later tonight at the earliest.
>

After thinking about it some more: _should_ it be corrected? Or wouldn't it be 
quite acceptable if manually constructed PKs could only be assigned by some 
workaround (like entering them in a textbox without data binding and 
assigning them to the right database field by code)? Because it certainly is 
and should be a non standard practice. But I haven't tried this out and at 
the moment I don't really know how to code such a workaround.

Thinking a little more about this leads me to a wish: could the dBizobj class 
allow the manual assignment not only of one UserSQL (select) statement, but 
of user defined statements for INSERT, UPDATE, DELETE? That's possible, but 
not mandatory with ADO.NET, for example, and I think it's a good thing.

>       Also, it is expected behavior that your local copy of the data would
> not have data that was modified by a trigger on the server; likewise,
> if another user had modified a record that you have in your local
> dataset, you wouldn't see their changes, either, as these only exist
> on the server. In order to get that data, you would need to call
> self.requery() from the bizobj's afterSave() method.
>

I see. 

Thank you,
Sibylle

-- 
Dr. Sibylle Koczian


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]

Reply via email to