-
Notifications
You must be signed in to change notification settings - Fork 0
/
exit
236 lines (235 loc) · 9.71 KB
/
exit
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
Help on QuerySet in module django.db.models.query object:
class QQuueerryySSeett(__builtin__.object)
| Represents a lazy database lookup for a set of objects.
|
| Methods defined here:
|
| ____aanndd____(self, other)
|
| ____bbooooll____(self)
|
| ____ddeeeeppccooppyy____(self, memo)
| Deep copy of a QuerySet doesn't populate the cache
|
| ____ggeettiitteemm____(self, k)
| Retrieves an item or slice from the set of results.
|
| ____ggeettssttaattee____(self)
| Allows the QuerySet to be pickled.
|
| ____iinniitt____(self, model=None, query=None, using=None, hints=None)
|
| ____iitteerr____(self)
| The queryset iterator protocol uses three nested iterators in the
| default case:
| 1. sql.compiler:execute_sql()
| - Returns 100 rows at time (constants.GET_ITERATOR_CHUNK_SIZE)
| using cursor.fetchmany(). This part is responsible for
| doing some column masking, and returning the rows in chunks.
| 2. sql/compiler.results_iter()
| - Returns one row at time. At this point the rows are still just
| tuples. In some cases the return values are converted to
| Python values at this location.
| 3. self.iterator()
| - Responsible for turning the rows into model objects.
|
| ____lleenn____(self)
|
| ____nnoonnzzeerroo____(self)
|
| ____oorr____(self, other)
|
| ____rreepprr____(self)
|
| ____sseettssttaattee____(self, state)
|
| aaggggrreeggaattee(self, *args, **kwargs)
| Returns a dictionary containing the calculations (aggregation)
| over the current queryset
|
| If args is present the expression is passed as a kwarg using
| the Aggregate object's default alias.
|
| aallll(self)
| Returns a new QuerySet that is a copy of the current one. This allows a
| QuerySet to proxy for a model manager in some cases.
|
| aannnnoottaattee(self, *args, **kwargs)
| Return a query set in which the returned objects have been annotated
| with extra data or aggregations.
|
| bbuullkk__ccrreeaattee(self, objs, batch_size=None)
| Inserts each of the instances into the database. This does *not* call
| save() on each of the instances, does not send any pre/post save
| signals, and does not set the primary key attribute if it is an
| autoincrement field (except if features.can_return_ids_from_bulk_insert=True).
| Multi-table models are not supported.
|
| ccoommpplleexx__ffiilltteerr(self, filter_obj)
| Returns a new QuerySet instance with filter_obj added to the filters.
|
| filter_obj can be a Q object (or anything with an add_to_query()
| method) or a dictionary of keyword lookup arguments.
|
| This exists to support framework features such as 'limit_choices_to',
| and usually it will be more natural to use other methods.
|
| ccoouunntt(self)
| Performs a SELECT COUNT() and returns the number of records as an
| integer.
|
| If the QuerySet is already fully cached this simply returns the length
| of the cached results set to avoid multiple SELECT COUNT(*) calls.
|
| ccrreeaattee(self, **kwargs)
| Creates a new object with the given kwargs, saving it to the database
| and returning the created object.
|
| ddaatteess(self, field_name, kind, order='ASC')
| Returns a list of date objects representing all available dates for
| the given field_name, scoped to 'kind'.
|
| ddaatteettiimmeess(self, field_name, kind, order='ASC', tzinfo=None)
| Returns a list of datetime objects representing all available
| datetimes for the given field_name, scoped to 'kind'.
|
| ddeeffeerr(self, *fields)
| Defers the loading of data for certain fields until they are accessed.
| The set of fields to defer is added to any existing set of deferred
| fields. The only exception to this is if None is passed in as the only
| parameter, in which case all deferrals are removed (None acts as a
| reset option).
|
| ddeelleettee(self)
| Deletes the records in the current QuerySet.
|
| ddiissttiinncctt(self, *field_names)
| Returns a new QuerySet instance that will select only distinct results.
|
| eeaarrlliieesstt(self, field_name=None)
|
| eexxcclluuddee(self, *args, **kwargs)
| Returns a new QuerySet instance with NOT (args) ANDed to the existing
| set.
|
| eexxiissttss(self)
|
| eexxttrraa(self, select=None, where=None, params=None, tables=None, order_by=None, select_params=None)
| Adds extra SQL fragments to the query.
|
| ffiilltteerr(self, *args, **kwargs)
| Returns a new QuerySet instance with the args ANDed to the existing
| set.
|
| ffiirrsstt(self)
| Returns the first object of a query, returns None if no match is found.
|
| ggeett(self, *args, **kwargs)
| Performs the query and returns a single object matching the given
| keyword arguments.
|
| ggeett__oorr__ccrreeaattee(self, defaults=None, **kwargs)
| Looks up an object with the given kwargs, creating one if necessary.
| Returns a tuple of (object, created), where created is a boolean
| specifying whether an object was created.
|
| iinn__bbuullkk(self, id_list=None)
| Returns a dictionary mapping each of the given IDs to the object with
| that ID. If `id_list` isn't provided, the entire QuerySet is evaluated.
|
| iiss__ccoommppaattiibbllee__qquueerryy__oobbjjeecctt__ttyyppee(self, opts, field)
| Check that using this queryset as the rhs value for a lookup is
| allowed. The opts are the options of the relation's target we are
| querying against. For example in .filter(author__in=Author.objects.all())
| the opts would be Author's (from the author field) and self.model would
| be Author.objects.all() queryset's .model (Author also). The field is
| the related field on the lhs side.
|
| iitteerraattoorr(self)
| An iterator over the results from applying this QuerySet to the
| database.
|
| llaasstt(self)
| Returns the last object of a query, returns None if no match is found.
|
| llaatteesstt(self, field_name=None)
|
| nnoonnee(self)
| Returns an empty QuerySet.
|
| oonnllyy(self, *fields)
| Essentially, the opposite of defer. Only the fields passed into this
| method and that are not already specified as deferred are loaded
| immediately when the queryset is evaluated.
|
| oorrddeerr__bbyy(self, *field_names)
| Returns a new QuerySet instance with the ordering changed.
|
| pprreeffeettcchh__rreellaatteedd(self, *lookups)
| Returns a new QuerySet instance that will prefetch the specified
| Many-To-One and Many-To-Many related objects when the QuerySet is
| evaluated.
|
| When prefetch_related() is called more than once, the list of lookups to
| prefetch is appended to. If prefetch_related(None) is called, the list
| is cleared.
|
| rraaww(self, raw_query, params=None, translations=None, using=None)
|
| rreevveerrssee(self)
| Reverses the ordering of the QuerySet.
|
| sseelleecctt__ffoorr__uuppddaattee(self, nowait=False)
| Returns a new QuerySet instance that will select objects with a
| FOR UPDATE lock.
|
| sseelleecctt__rreellaatteedd(self, *fields)
| Returns a new QuerySet instance that will select related objects.
|
| If fields are specified, they must be ForeignKey fields and only those
| related objects are included in the selection.
|
| If select_related(None) is called, the list is cleared.
|
| uuppddaattee(self, **kwargs)
| Updates all elements in the current QuerySet, setting all the given
| fields to the appropriate values.
|
| uuppddaattee__oorr__ccrreeaattee(self, defaults=None, **kwargs)
| Looks up an object with the given kwargs, updating one with defaults
| if it exists, otherwise creates a new one.
| Returns a tuple (object, created), where created is a boolean
| specifying whether an object was created.
|
| uussiinngg(self, alias)
| Selects which database this QuerySet should execute its query against.
|
| vvaalluueess(self, *fields)
|
| vvaalluueess__lliisstt(self, *fields, **kwargs)
|
| ----------------------------------------------------------------------
| Class methods defined here:
|
| aass__mmaannaaggeerr(cls) from __builtin__.type
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| ____ddiicctt____
| dictionary for instance variables (if defined)
|
| ____wweeaakkrreeff____
| list of weak references to the object (if defined)
|
| ddbb
| Return the database that will be used if this query is executed now
|
| oorrddeerreedd
| Returns True if the QuerySet is ordered -- i.e. has an order_by()
| clause or a default ordering on the model.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| vvaalluuee__aannnnoottaattiioonn = True