On Wed, May 13, 2009 at 21:48, Lars Kellogg-Stedman <[email protected]> wrote:

> This is my first time around with Elixir (and sqlalchemy), so forgive
> me if my questions seem naive.  I'm working on a simple application
> for which I want pretty much bog-standard tagging support.   My search
> ultimately led me to Elixir's associable extension, which seems to
> work, mostly.  Then I ran across 
> http://elixir.ematia.de/trac/wiki/Recipes/TagCloud,
> which says:
>
>  However, [the associable extension] is not recommended because that
> extension usually brings more problems than it solves and will soon be
> deprecated.
>
> Well, great.  Is this true (that associable may ultimately go away)?

associable under its current form will indeed go away.

> So, I looked into association proxies, which look interesting, but
> seem to suffer from a different problem: specifically, while tagging
> with associable lets me apply tags to multiple classes, the examples
> I've seen using association proxies only allow the tags to apply to a
> specific class.  Is this true in general, or is this just the nature
> of the examples?

Just the nature of the example.  For example, this is perfectly valid:

class Tag(Entity):
    name = Field(Unicode)
    entries = ManyToMany('Entry') # this line is optional!
    articles = ManyToMany('Article') # this line is optional!

class Entry(Entity):
    title = Field(Unicode)
    tags = ManyToMany('Tag')

class Article(Entity):
    title = Field(Unicode)
    tags = ManyToMany('Tag')

> I guess I'm looking for your recommendations regarding "best
> practices" for implementing a tagging system on top of Elixir, when
> one of the requirements is that the tags can be applied to different
> classes (that do no share a common ancestor).

As is said in the recipe, it depends on what you need: in the basic
use case, standard ManyToMany relationships are your best bet.

-- 
Gaëtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to