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

« back to all changes in this revision

Viewing changes to doc/build/core/types.rst

  • 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:
41
41
Standard Types`_ and the other sections of this chapter.
42
42
 
43
43
.. autoclass:: BigInteger
44
 
  :show-inheritance:
45
 
  :members:
 
44
   :members:
46
45
 
47
46
.. autoclass:: Boolean
48
 
  :show-inheritance:
49
 
  :members:
 
47
   :members:
50
48
 
51
49
.. autoclass:: Date
52
 
 :show-inheritance:
53
 
 :members:
 
50
   :members:
54
51
 
55
52
.. autoclass:: DateTime
56
 
   :show-inheritance:
57
53
   :members:
58
54
 
59
55
.. autoclass:: Enum
60
 
  :show-inheritance:
61
56
  :members: __init__, create, drop
62
57
 
63
58
.. autoclass:: Float
64
 
  :show-inheritance:
65
59
  :members:
66
60
 
67
61
.. autoclass:: Integer
68
 
  :show-inheritance:
69
62
  :members:
70
63
 
71
64
.. autoclass:: Interval
72
 
 :show-inheritance:
73
 
 :members:
 
65
  :members:
74
66
 
75
67
.. autoclass:: LargeBinary
76
 
 :show-inheritance:
77
 
 :members:
 
68
  :members:
78
69
 
79
70
.. autoclass:: Numeric
80
 
  :show-inheritance:
81
71
  :members:
82
72
 
83
73
.. autoclass:: PickleType
84
 
 :show-inheritance:
85
 
 :members:
 
74
  :members:
86
75
 
87
76
.. autoclass:: SchemaType
88
 
  :show-inheritance:
89
77
  :members:
90
78
  :undoc-members:
91
79
 
92
80
.. autoclass:: SmallInteger
93
 
 :show-inheritance:
94
 
 :members:
 
81
  :members:
95
82
 
96
83
.. autoclass:: String
97
 
   :show-inheritance:
98
84
   :members:
99
85
 
100
86
.. autoclass:: Text
101
 
   :show-inheritance:
102
87
   :members:
103
88
 
104
89
.. autoclass:: Time
105
 
  :show-inheritance:
106
90
  :members:
107
91
 
108
92
.. autoclass:: Unicode
109
 
  :show-inheritance:
110
93
  :members:
111
94
 
112
95
.. autoclass:: UnicodeText
113
 
   :show-inheritance:
114
96
   :members:
115
97
 
116
98
.. _types_sqlstandard:
123
105
on all databases.
124
106
 
125
107
.. autoclass:: BIGINT
126
 
  :show-inheritance:
 
108
 
127
109
 
128
110
.. autoclass:: BINARY
129
 
  :show-inheritance:
 
111
 
130
112
 
131
113
.. autoclass:: BLOB
132
 
  :show-inheritance:
 
114
 
133
115
 
134
116
.. autoclass:: BOOLEAN
135
 
  :show-inheritance:
 
117
 
136
118
 
137
119
.. autoclass:: CHAR
138
 
  :show-inheritance:
 
120
 
139
121
 
140
122
.. autoclass:: CLOB
141
 
  :show-inheritance:
 
123
 
142
124
 
143
125
.. autoclass:: DATE
144
 
  :show-inheritance:
 
126
 
145
127
 
146
128
.. autoclass:: DATETIME
147
 
  :show-inheritance:
 
129
 
148
130
 
149
131
.. autoclass:: DECIMAL
150
 
  :show-inheritance:
 
132
 
151
133
 
152
134
.. autoclass:: FLOAT
153
 
  :show-inheritance:
 
135
 
154
136
 
155
137
.. autoclass:: INT
156
 
  :show-inheritance:
 
138
 
157
139
 
158
140
.. autoclass:: sqlalchemy.types.INTEGER
159
 
  :show-inheritance:
 
141
 
160
142
 
161
143
.. autoclass:: NCHAR
162
 
  :show-inheritance:
 
144
 
163
145
 
164
146
.. autoclass:: NVARCHAR
165
 
  :show-inheritance:
 
147
 
166
148
 
167
149
.. autoclass:: NUMERIC
168
 
  :show-inheritance:
 
150
 
169
151
 
170
152
.. autoclass:: REAL
171
 
  :show-inheritance:
 
153
 
172
154
 
173
155
.. autoclass:: SMALLINT
174
 
  :show-inheritance:
 
156
 
175
157
 
176
158
.. autoclass:: TEXT
177
 
  :show-inheritance:
 
159
 
178
160
 
179
161
.. autoclass:: TIME
180
 
  :show-inheritance:
 
162
 
181
163
 
182
164
.. autoclass:: TIMESTAMP
183
 
  :show-inheritance:
 
165
 
184
166
 
185
167
.. autoclass:: VARBINARY
186
 
  :show-inheritance:
 
168
 
187
169
 
188
170
.. autoclass:: VARCHAR
189
 
  :show-inheritance:
 
171
 
190
172
 
191
173
.. _types_vendor:
192
174
 
194
176
---------------------
195
177
 
196
178
Database-specific types are also available for import from each
197
 
database's dialect module. See the :ref:`sqlalchemy.dialects_toplevel`
 
179
database's dialect module. See the :ref:`dialect_toplevel`
198
180
reference for the database you're interested in.
199
181
 
200
182
For example, MySQL has a ``BIGINT`` type and PostgreSQL has an
300
282
.. autoclass:: TypeDecorator
301
283
   :members:
302
284
   :inherited-members:
303
 
   :show-inheritance:
 
285
 
304
286
 
305
287
TypeDecorator Recipes
306
288
~~~~~~~~~~~~~~~~~~~~~
361
343
                value = value.quantize(self.quantize)
362
344
            return value
363
345
 
 
346
.. _custom_guid_type:
 
347
 
364
348
Backend-agnostic GUID Type
365
349
^^^^^^^^^^^^^^^^^^^^^^^^^^
366
350
 
690
674
    class MyInt(Integer):
691
675
        class comparator_factory(Integer.Comparator):
692
676
            def log(self, other):
693
 
                return func.log(self, other)
 
677
                return func.log(self.expr, other)
694
678
 
695
679
Using the above type::
696
680
 
738
722
 
739
723
.. autoclass:: UserDefinedType
740
724
   :members:
741
 
   :show-inheritance:
 
725
 
742
726
 
743
727
.. _types_api:
744
728
 
747
731
 
748
732
.. autoclass:: AbstractType
749
733
   :members:
750
 
   :show-inheritance:
 
734
 
751
735
 
752
736
.. autoclass:: TypeEngine
753
737
   :members:
754
 
   :show-inheritance:
 
738
 
755
739
 
756
740
.. autoclass:: Concatenable
757
741
   :members:
758
742
   :inherited-members:
759
 
   :show-inheritance:
 
743
 
760
744
 
761
745
.. autoclass:: NullType
762
 
   :show-inheritance:
 
746
 
763
747
 
764
748
.. autoclass:: Variant
765
 
   :show-inheritance:
 
749
 
766
750
   :members: with_variant, __init__