passing sequences to the activemapper's column class is very awkward

Issue #153 resolved
Former user created an issue

For oracle at least, you're likely to want a sequence for many if not all primary keys. Because the Column class won't accept these as keyword args the syntax is currently awkward:

class Page(ActiveMapper):

    class mapping:
        page_id = column(Integer, None, None, True, Sequence('seq_Page'))
        pagename = column (String(30), unique=True)
        data=column(Unicode)

Much better would be:

page_id = column(Integer, primary_key=True, sequence=Sequence('seq_Page'))

Comments (3)

  1. Mike Bayer repo owner

    might want to use "default" as the keyword argument since a Sequence is just one kind of "default" that can be used with a Column.

  2. Log in to comment