mviamari wrote:
Hello,
I'm writing tests for my database, and I've run into a little bit of
confusion.
Say I have a class (we'll call it person) with two declared attributes
that correspond to db columns:
person.id
person.name
If I randomly assign a person object another attribute
So if I read the documentation right, it appears that because I'm
accessing the object via the primary key, it looks the object up
locally (i.e. in the session) and returns that object. Other than
doing a query/lookup on another attribute, how can I force it to
create the object from the data in
Michael,
First, Thanks for your help.
Second, something still isn't right. Here's the code in question:
obj = Obj()
org = Org()
self.assertNotEqual(obj, None)
self.assertNotEqual(org, None)
#Nonsense_var is not representative of a table column,
UPDATE: If I inject a session.expunge_all() before I query the DB for
the objects again, the undeclared attribute is no longer present
(i.e. I get the AttributeError I expect).
On Oct 14, 7:08 pm, mviamari mviam...@gmail.com wrote:
Michael,
First, Thanks for your help.
Second, something