if it has an id, it's not new
--
Javier
works, but it's nicer to use "if hasattr(obj,field): ...."
> More generally, what do you think of this statement: "If there are
> any cases where you don't absolutely know if a variable is defined,
> you have a broken design."
it's generally reasonable; but in this case it's not about an
undefined variable; it's an attribute. Since the ID value is defined
only by the database, it's reasonable to leave it undefined until it's
defined :-)
--
Javier