kerinin schrieb:
> I'm trying to migrate from SQLObject to SQLAlchemy / Elixir and I'm
> running into problem implementing SQLObject's _get_ and _set_
> functions. Here's the code in question:
>
> class Video(elixir.Entity):
> def _get_youtube_id(self):
> return self.uri.split('/')[-1]
> elixir.has_property('youtube_id',_get_youtube_id)
>
> In SQLObject the getter works fine, but now when I try to run it with
> Elixir I get this error:
You don't use the has_property-declaration properly.
It's meant to work for *SQL*-based properties, not for "normal" properties.
So a simple
@property
def youtube_id(self):
return self.uri.split("/")[-1]
will work.
Diez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---