summaryrefslogtreecommitdiff
path: root/python/helpers/pydev/stubs/_django_manager_body.py
blob: 2bf47067ce3e64813fcb0942826f07a442c58199 (plain)
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# This is a dummy for code-completion purposes.

def __unicode__(self):
    """
    Return "app_label.model_label.manager_name". 
    """

def _copy_to_model(self, model):
    """
    Makes a copy of the manager and assigns it to 'model', which should be
    a child of the existing model (used when inheriting a manager from an
    abstract base class).
    """


def _db(self):
    """

    """


def _get_queryset_methods(cls, queryset_class):
    """

    """


def _hints(self):
    """
    dict() -> new empty dictionary
    dict(mapping) -> new dictionary initialized from a mapping object's
        (key, value) pairs
    dict(iterable) -> new dictionary initialized as if via:
        d = {}
        for k, v in iterable:
            d[k] = v
    dict(**kwargs) -> new dictionary initialized with the name=value pairs
        in the keyword argument list.  For example:  dict(one=1, two=2)
    """


def _inherited(self):
    """

    """


def _insert(self, *args, **kwargs):
    """
    Inserts a new record for the given model. This provides an interface to
    the InsertQuery class and is how Model.save() is implemented.
    """


def _queryset_class(self):
    """
    Represents a lazy database lookup for a set of objects.
    """


def _set_creation_counter(self):
    """
    Sets the creation counter value for this instance and increments the
    class-level copy.
    """


def _update(self, *args, **kwargs):
    """
    A version of update that accepts field objects instead of field names.
    Used primarily for model saving and not intended for use by general
    code (it requires too much poking around at model internals to be
    useful at that level).
    """


def aggregate(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.
    """


def all(self):
    """
    @rtype: django.db.models.query.QuerySet
    """


def annotate(self, *args, **kwargs):
    """
    Return a query set in which the returned objects have been annotated
    with data aggregated from related fields.
    """


def bulk_create(self, *args, **kwargs):
    """
    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.
    """


def check(self, **kwargs):
    """

    """


def complex_filter(self, *args, **kwargs):
    """
    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.
    
    @rtype: django.db.models.query.QuerySet
    """


def contribute_to_class(self, model, name):
    """

    """


def count(self, *args, **kwargs):
    """
    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.
    """


def create(self, *args, **kwargs):
    """
    Creates a new object with the given kwargs, saving it to the database
    and returning the created object.
    """


def creation_counter(self):
    """

    """


def dates(self, *args, **kwargs):
    """
    Returns a list of date objects representing all available dates for
    the given field_name, scoped to 'kind'.
    """


def datetimes(self, *args, **kwargs):
    """
    Returns a list of datetime objects representing all available
    datetimes for the given field_name, scoped to 'kind'.
    """


def db(self):
    """

    """


def db_manager(self, using=None, hints=None):
    """

    """


def defer(self, *args, **kwargs):
    """
    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).
    """


def distinct(self, *args, **kwargs):
    """
    Returns a new QuerySet instance that will select only distinct results.
    
    @rtype: django.db.models.query.QuerySet
    """


def earliest(self, *args, **kwargs):
    """

    """


def exclude(self, *args, **kwargs):
    """
    Returns a new QuerySet instance with NOT (args) ANDed to the existing
    set.
    
    @rtype: django.db.models.query.QuerySet
    """


def exists(self, *args, **kwargs):
    """

    """


def extra(self, *args, **kwargs):
    """
    Adds extra SQL fragments to the query.
    """


def filter(self, *args, **kwargs):
    """
    Returns a new QuerySet instance with the args ANDed to the existing
    set.
    
    @rtype: django.db.models.query.QuerySet
    """


def first(self, *args, **kwargs):
    """
    Returns the first object of a query, returns None if no match is found.
    """


def from_queryset(cls, queryset_class, class_name=None):
    """

    """


def get(self, *args, **kwargs):
    """
    Performs the query and returns a single object matching the given
    keyword arguments.
    """


def get_or_create(self, *args, **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.
    """


def get_queryset(self):
    """
    Returns a new QuerySet object.  Subclasses can override this method to
    easily customize the behavior of the Manager.
    
    @rtype: django.db.models.query.QuerySet
    """


def in_bulk(self, *args, **kwargs):
    """
    Returns a dictionary mapping each of the given IDs to the object with
    that ID.
    """


def iterator(self, *args, **kwargs):
    """
    An iterator over the results from applying this QuerySet to the
    database.
    """


def last(self, *args, **kwargs):
    """
    Returns the last object of a query, returns None if no match is found.
    """


def latest(self, *args, **kwargs):
    """

    """


def model(self):
    """
    MyModel(id)
    """


def none(self, *args, **kwargs):
    """
    Returns an empty QuerySet.
    
    @rtype: django.db.models.query.QuerySet
    """


def only(self, *args, **kwargs):
    """
    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.
    """


def order_by(self, *args, **kwargs):
    """
    Returns a new QuerySet instance with the ordering changed.
    
    @rtype: django.db.models.query.QuerySet
    """


def prefetch_related(self, *args, **kwargs):
    """
    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.
    
    @rtype: django.db.models.query.QuerySet
    """


def raw(self, *args, **kwargs):
    """

    """


def reverse(self, *args, **kwargs):
    """
    Reverses the ordering of the QuerySet.
    
    @rtype: django.db.models.query.QuerySet
    """


def select_for_update(self, *args, **kwargs):
    """
    Returns a new QuerySet instance that will select objects with a
    FOR UPDATE lock.
    
    @rtype: django.db.models.query.QuerySet
    """


def select_related(self, *args, **kwargs):
    """
    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.
    
    @rtype: django.db.models.query.QuerySet
    """


def update(self, *args, **kwargs):
    """
    Updates all elements in the current QuerySet, setting all the given
    fields to the appropriate values.
    """


def update_or_create(self, *args, **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.
    """


def using(self, *args, **kwargs):
    """
    Selects which database this QuerySet should execute its query against.
    
    @rtype: django.db.models.query.QuerySet
    """


def values(self, *args, **kwargs):
    """

    """


def values_list(self, *args, **kwargs):
    """

    """