On Jun 28, 2010, at 5:33 AM, Andronikos Nedos wrote:
> Hi,
>
> I'm wondering if SA can help in the following situation.
>
> I'm trying to store a schedule which can be reduced to an id and a
> recurrence rule encoded as an rrule from python-dateutil. Something
> like the following:
>
> schedule = Table('schedules_table', meta,
> Column('id', Integer, primary_key=True),
> Column('rrule', PickleType, nullable=False))
>
> Ideally, I would like to query such a table and get back a list of
> (potentially) same id's but with different dates as derived by the
> recurrence rule. It's not always convenient to expand the recurrence
> rule and store corresponding dates in children of the schedule table,
> as such rules can be infinite.
>
> Now, this brakes the relational model but I'm still wondering whether
> there is an SA pattern I can follow, possibly extending a list
> collection class or constructing a relation based on the rrule
> attribute, to do what I want.
>
> Any help greatly appreciated,
> Andronikos
>
SQLAlchemy handles just the SQL part, so once you query your table you'd use
Python code to expand out the rrules into a collection of non-ORM
objects/tuples/whatever with individual dates.
> --
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" 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/sqlalchemy?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en.