-
Notifications
You must be signed in to change notification settings - Fork 23
/
TODO
29 lines (20 loc) · 1.01 KB
/
TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
* GTFS export from database.
* Eliminate dependency on SQLite; gtfs should work on any DB which SQLAlchemy
supports.
* Make it possible to open more than one schedule at once; the following code
currently doesn't work:
from gtfs import Schedule
from gtfs.entity import *
sched1 = Schedule('bart.db') #open first schedule
print sched1.agencies #works fine
print Agency.query.all() #also works fine
sched2 = Schedule('nyct.db') #open second schedule
print sched2.agencies #works fine
print Agency.query.all() #works, but gives results from sched2
The problem is this line in Schedule:
Base.metadata.bind = self.engine
This creates a global shared state across the entity classes, so they are
bound to the most recently instantited Schedule object
* Investigate using GeoAlchemy for real geospatial support? GeoAlchemy plus a
geo-enabled database might be too heavy a dependency for some cases; setup of
PostGIS (or Spatialite, etc.) is non-trivial.