diff --git a/django/db/models/lookups.py b/django/db/models/lookups.py
index 5429204..1dddcc8 100644
a
|
b
|
class FieldGetDbPrepValueIterableMixin(FieldGetDbPrepValueMixin):
|
235 | 235 | return sql, tuple(params) |
236 | 236 | |
237 | 237 | |
| 238 | @Field.register_lookup |
238 | 239 | class Exact(FieldGetDbPrepValueMixin, BuiltinLookup): |
239 | 240 | lookup_name = 'exact' |
240 | 241 | |
241 | 242 | |
242 | | Field.register_lookup(Exact) |
243 | | |
244 | | |
| 243 | @Field.register_lookup |
245 | 244 | class IExact(BuiltinLookup): |
246 | 245 | lookup_name = 'iexact' |
247 | 246 | prepare_rhs = False |
… |
… |
class IExact(BuiltinLookup):
|
253 | 252 | return rhs, params |
254 | 253 | |
255 | 254 | |
256 | | Field.register_lookup(IExact) |
257 | | |
258 | | |
| 255 | @Field.register_lookup |
259 | 256 | class GreaterThan(FieldGetDbPrepValueMixin, BuiltinLookup): |
260 | 257 | lookup_name = 'gt' |
261 | 258 | |
262 | 259 | |
263 | | Field.register_lookup(GreaterThan) |
264 | | |
265 | | |
| 260 | @Field.register_lookup |
266 | 261 | class GreaterThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup): |
267 | 262 | lookup_name = 'gte' |
268 | 263 | |
269 | 264 | |
270 | | Field.register_lookup(GreaterThanOrEqual) |
271 | | |
272 | | |
| 265 | @Field.register_lookup |
273 | 266 | class LessThan(FieldGetDbPrepValueMixin, BuiltinLookup): |
274 | 267 | lookup_name = 'lt' |
275 | 268 | |
276 | 269 | |
277 | | Field.register_lookup(LessThan) |
278 | | |
279 | | |
| 270 | @Field.register_lookup |
280 | 271 | class LessThanOrEqual(FieldGetDbPrepValueMixin, BuiltinLookup): |
281 | 272 | lookup_name = 'lte' |
282 | 273 | |
283 | 274 | |
284 | | Field.register_lookup(LessThanOrEqual) |
285 | | |
286 | | |
287 | 275 | class IntegerFieldFloatRounding(object): |
288 | 276 | """ |
289 | 277 | Allow floats to work as query values for IntegerField. Without this, the |
… |
… |
class IntegerFieldFloatRounding(object):
|
295 | 283 | return super(IntegerFieldFloatRounding, self).get_prep_lookup() |
296 | 284 | |
297 | 285 | |
| 286 | @IntegerField.register_lookup |
298 | 287 | class IntegerGreaterThanOrEqual(IntegerFieldFloatRounding, GreaterThanOrEqual): |
299 | 288 | pass |
300 | 289 | |
301 | 290 | |
302 | | IntegerField.register_lookup(IntegerGreaterThanOrEqual) |
303 | | |
304 | | |
| 291 | @IntegerField.register_lookup |
305 | 292 | class IntegerLessThan(IntegerFieldFloatRounding, LessThan): |
306 | 293 | pass |
307 | 294 | |
308 | 295 | |
309 | | IntegerField.register_lookup(IntegerLessThan) |
310 | | |
311 | | |
312 | 296 | class DecimalComparisonLookup(object): |
313 | 297 | def as_sqlite(self, compiler, connection): |
314 | 298 | lhs_sql, params = self.process_lhs(compiler, connection) |
… |
… |
class DecimalLessThanOrEqual(DecimalComparisonLookup, LessThanOrEqual):
|
343 | 327 | pass |
344 | 328 | |
345 | 329 | |
| 330 | @Field.register_lookup |
346 | 331 | class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup): |
347 | 332 | lookup_name = 'in' |
348 | 333 | |
… |
… |
class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
403 | 388 | return ''.join(in_clause_elements), params |
404 | 389 | |
405 | 390 | |
406 | | Field.register_lookup(In) |
407 | | |
408 | | |
409 | 391 | class PatternLookup(BuiltinLookup): |
410 | 392 | |
411 | 393 | def get_rhs_op(self, connection, rhs): |
… |
… |
class PatternLookup(BuiltinLookup):
|
425 | 407 | return super(PatternLookup, self).get_rhs_op(connection, rhs) |
426 | 408 | |
427 | 409 | |
| 410 | @Field.register_lookup |
428 | 411 | class Contains(PatternLookup): |
429 | 412 | lookup_name = 'contains' |
430 | 413 | prepare_rhs = False |
… |
… |
class Contains(PatternLookup):
|
436 | 419 | return rhs, params |
437 | 420 | |
438 | 421 | |
439 | | Field.register_lookup(Contains) |
440 | | |
441 | | |
| 422 | @Field.register_lookup |
442 | 423 | class IContains(Contains): |
443 | 424 | lookup_name = 'icontains' |
444 | 425 | prepare_rhs = False |
445 | 426 | |
446 | 427 | |
447 | | Field.register_lookup(IContains) |
448 | | |
449 | | |
| 428 | @Field.register_lookup |
450 | 429 | class StartsWith(PatternLookup): |
451 | 430 | lookup_name = 'startswith' |
452 | 431 | prepare_rhs = False |
… |
… |
class StartsWith(PatternLookup):
|
458 | 437 | return rhs, params |
459 | 438 | |
460 | 439 | |
461 | | Field.register_lookup(StartsWith) |
462 | | |
463 | | |
| 440 | @Field.register_lookup |
464 | 441 | class IStartsWith(PatternLookup): |
465 | 442 | lookup_name = 'istartswith' |
466 | 443 | prepare_rhs = False |
… |
… |
class IStartsWith(PatternLookup):
|
472 | 449 | return rhs, params |
473 | 450 | |
474 | 451 | |
475 | | Field.register_lookup(IStartsWith) |
476 | | |
477 | | |
| 452 | @Field.register_lookup |
478 | 453 | class EndsWith(PatternLookup): |
479 | 454 | lookup_name = 'endswith' |
480 | 455 | prepare_rhs = False |
… |
… |
class EndsWith(PatternLookup):
|
486 | 461 | return rhs, params |
487 | 462 | |
488 | 463 | |
489 | | Field.register_lookup(EndsWith) |
490 | | |
491 | | |
| 464 | @Field.register_lookup |
492 | 465 | class IEndsWith(PatternLookup): |
493 | 466 | lookup_name = 'iendswith' |
494 | 467 | prepare_rhs = False |
… |
… |
class IEndsWith(PatternLookup):
|
500 | 473 | return rhs, params |
501 | 474 | |
502 | 475 | |
503 | | Field.register_lookup(IEndsWith) |
504 | | |
505 | | |
| 476 | @Field.register_lookup |
506 | 477 | class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup): |
507 | 478 | lookup_name = 'range' |
508 | 479 | |
… |
… |
class Range(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
|
510 | 481 | return "BETWEEN %s AND %s" % (rhs[0], rhs[1]) |
511 | 482 | |
512 | 483 | |
513 | | Field.register_lookup(Range) |
514 | | |
515 | | |
| 484 | @Field.register_lookup |
516 | 485 | class IsNull(BuiltinLookup): |
517 | 486 | lookup_name = 'isnull' |
518 | 487 | prepare_rhs = False |
… |
… |
class IsNull(BuiltinLookup):
|
525 | 494 | return "%s IS NOT NULL" % sql, params |
526 | 495 | |
527 | 496 | |
528 | | Field.register_lookup(IsNull) |
529 | | |
530 | | |
| 497 | @Field.register_lookup |
531 | 498 | class Search(BuiltinLookup): |
532 | 499 | lookup_name = 'search' |
533 | 500 | prepare_rhs = False |
… |
… |
class Search(BuiltinLookup):
|
543 | 510 | return sql_template, lhs_params + rhs_params |
544 | 511 | |
545 | 512 | |
546 | | Field.register_lookup(Search) |
547 | | |
548 | | |
| 513 | @Field.register_lookup |
549 | 514 | class Regex(BuiltinLookup): |
550 | 515 | lookup_name = 'regex' |
551 | 516 | prepare_rhs = False |
… |
… |
class Regex(BuiltinLookup):
|
560 | 525 | return sql_template % (lhs, rhs), lhs_params + rhs_params |
561 | 526 | |
562 | 527 | |
563 | | Field.register_lookup(Regex) |
564 | | |
565 | | |
| 528 | @Field.register_lookup |
566 | 529 | class IRegex(Regex): |
567 | 530 | lookup_name = 'iregex' |
568 | 531 | |
569 | 532 | |
570 | | Field.register_lookup(IRegex) |
571 | | |
572 | | |
573 | 533 | class YearLookup(Lookup): |
574 | 534 | def year_lookup_bounds(self, connection, year): |
575 | 535 | output_field = self.lhs.lhs.output_field |