On Jan 2, 2008, at 8:52 PM, andresj wrote:

> I do have properties for url (this is the example I sent), parent and
> name.
>
> When I deleted map_column from 'parent': synonym('_parent',
> map_column=True) and imported the module everything was all right. But
> when I run my tests (basically just creating a Resource() object and
> setting properties to see if the code in them work properly), it
> raises and exception:
>
>  File "[...]/model/resources.py", line 118, in _set_url
>    self.parent.save()
> AttributeError: 'Resource' object has no attribute 'parent'
>
> Which only happens when I try to access Resource().parent.*; when I
> "print repr()" Resource().parent there is no problem... Apparently
> this problem is only with parent.
>

in the case of "parent", what happens if you just dont use a  
synonym ?   if it works then, there might be some silliness occuring  
when backrefs get set up.  the synonym for relation() is only  
important if youre really looking for the extra querying attributes on  
"parent".  you might also try adding it using add_property() after the  
mappers are compiled.  if any of those versions work, then thats your  
workaround for now and we'll put in a trac ticket.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to