Ticket #185 (new enhancement)
record.exists() does not behave as expected on records that have been loaded using load(id=pk,otherField=something)
| Reported by: | TomChiverton | Owned by: | dhughes |
|---|---|---|---|
| Type: | enhancement | Priority: | normal |
| Milestone: | 1.0 Release | Component: | Reactor - Record |
| Version: | Severity: | normal | |
| Keywords: | Cc: |
Description
Record.exists() will return true if the primary key of the current interal TO is valid (i.e. exists in the database).
The fact that the object was loaded using some other fields, and so may or many not represent a real item in the database, is ignored.
In fact the transfer object that gets returned will have the 'real' value of 'otherField' over written by the value given in the load() method, which is even odder.
The work around is to load the record and then check the field.
See also http://www.rachaelandtom.info/content/gotcha-reactor-records-and-exists
I'm not sure what the 'fix' should be, but my first though involves tracking which fields have been set, and how. Eww.
Change History
Note: See
TracTickets for help on using
tickets.

