custom list classes should be specified in relation()

Issue #212 resolved
Mike Bayer repo owner created an issue

custom list types are specifeid like this:

  class Foo(object):
     elements: sets.Set

  mapper(Foo, table, properties={'elements':relation(Element)})

having the sets.Set specified at the class level is inconsistent with everything else. this is a leftover from the old way this was done where classes would construct the list class themselves, etc. now it should be:

   class Foo(object):
     pass

  mapper(Foo, table, properties={'elements':relation(Element, collection=sets.Set)})

and deprecate the other way of doing it.

Comments (4)

  1. Log in to comment