278 |
278 |
279 class DBAPIRequest(RequestSessionBase): |
279 class DBAPIRequest(RequestSessionBase): |
280 |
280 |
281 def __init__(self, vreg, session=None): |
281 def __init__(self, vreg, session=None): |
282 super(DBAPIRequest, self).__init__(vreg) |
282 super(DBAPIRequest, self).__init__(vreg) |
|
283 #: 'language' => translation_function() mapping |
|
284 self.translation = {} |
283 try: |
285 try: |
284 # no vreg or config which doesn't handle translations |
286 # no vreg or config which doesn't handle translations |
285 self.translations = vreg.config.translations |
287 self.translations = vreg.config.translations |
286 except AttributeError: |
288 except AttributeError: |
287 self.translations = {} |
289 pass |
|
290 #: Request language identifier eg: 'en' |
|
291 self.lang = None |
288 self.set_default_language(vreg) |
292 self.set_default_language(vreg) |
289 # cache entities built during the request |
293 #: cache entities built during the request |
290 self._eid_cache = {} |
294 self._eid_cache = {} |
291 if session is not None: |
295 if session is not None: |
292 self.set_session(session) |
296 self.set_session(session) |
293 else: |
297 else: |
294 # these args are initialized after a connection is |
298 # these args are initialized after a connection is |