File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -150,13 +150,22 @@ def factory_from_cmdline(cls, args):
150
150
return cls .factory (** kwargs )
151
151
152
152
def prep_an_orm_class (self , orm_cls ):
153
+ self .prep_orm_class (orm_cls , self .schema , self .is_geospatial )
154
+
155
+ @classmethod
156
+ def prep_orm_class (cls , orm_cls , schema = None , is_geospatial = False ):
153
157
"""
154
158
helper method to ready an ORM class (see Base and it's children) according to this Database's settings
155
159
:why?: sometimes you might have classes you want as part of a query, but you don't want those classes
156
160
available in the Database.classes() or Database.sorted_classes(), since these tables are not being loaded, etc..
157
161
"""
158
- if self . is_geospatial and hasattr (orm_cls , 'add_geometry_column' ):
162
+ if is_geospatial and hasattr (orm_cls , 'add_geometry_column' ):
159
163
orm_cls .add_geometry_column ()
160
164
161
- if self .schema :
162
- orm_cls .set_schema (self .schema )
165
+ if schema :
166
+ orm_cls .set_schema (schema )
167
+
168
+ @classmethod
169
+ def prep_gtfsdb_model_classes (cls , schema = None , is_geo = False ):
170
+ for c in cls .get_base_subclasses ():
171
+ cls .prep_orm_class (c , schema , is_geo )
You can’t perform that action at this time.
0 commit comments