~ubuntu-branches/debian/jessie/sqlalchemy/jessie

« back to all changes in this revision

Viewing changes to lib/sqlalchemy/dialects/sqlite/base.py

  • Committer: Package Import Robot
  • Author(s): Piotr Ożarowski
  • Date: 2013-10-28 22:29:40 UTC
  • mfrom: (1.4.24)
  • Revision ID: package-import@ubuntu.com-20131028222940-wvyqffl4g617caun
Tags: 0.8.3-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
153
153
        if storage_format is not None:
154
154
            self._storage_format = storage_format
155
155
 
 
156
    def adapt(self, cls, **kw):
 
157
        if self._storage_format:
 
158
            kw["storage_format"] = self._storage_format
 
159
        if self._reg:
 
160
            kw["regexp"] = self._reg
 
161
        return util.constructor_copy(self, cls, **kw)
156
162
 
157
163
class DATETIME(_DateTimeMixin, sqltypes.DateTime):
158
164
    """Represent a Python datetime object in SQLite using a string.
173
179
 
174
180
        dt = DATETIME(
175
181
            storage_format="%(year)04d/%(month)02d/%(day)02d %(hour)02d:%(min)02d:%(second)02d",
176
 
            regexp=re.compile("(\d+)/(\d+)/(\d+) (\d+)-(\d+)-(\d+)")
 
182
            regexp=r"(\d+)/(\d+)/(\d+) (\d+)-(\d+)-(\d+)"
177
183
        )
178
184
 
179
185
    :param storage_format: format string which will be applied to the