Changes between Initial Version and Version 4 of Ticket #14786
- Timestamp:
- Feb 4, 2012, 4:12:16 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14786
- Property Cc added
- Property Has patch set
- Property Keywords sprintdec2010 fields lookup added
- Property Triage Stage Unreviewed → Accepted
- Property Version 1.2 → SVN
- Property Severity → Normal
- Property Type → Bug
- Property Easy pickings unset
- Property Patch needs improvement set
- Property UI/UX unset
-
Ticket #14786 – Description
initial v4 1 In db.models.fields.Field ''get_db_prep_lookup()'' check if value is prepared and prepare it: 2 {{{ 1 In db.models.fields.Field {{{get_db_prep_lookup()}}} check if value is prepared and prepare it: 2 3 {{{#!python 3 4 def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False): 4 5 "Returns field's value prepared for database lookup." … … 6 7 value = self.get_prep_lookup(lookup_type, value) 7 8 }}} 8 ''get_prep_lookup()'' call ''get_prep_value()''for every value.9 {{{get_prep_lookup()}}} call {{{get_prep_value()}}} for every value. 9 10 10 11 But look next: 11 {{{ 12 {{{#!python 12 13 elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'): 13 14 return [self.get_db_prep_value(value, connection=connection, prepared=prepared)] … … 15 16 return [self.get_db_prep_value(v, connection=connection, prepared=prepared) for v in value] 16 17 }}} 17 Prepared flag not changed and ''get_db_prep_value()'' call ''get_prep_value()'' through ''get_db_prep_value()''again!18 Prepared flag not changed and {{{get_db_prep_value()}}} call {{{get_prep_value()}}} through {{{get_db_prep_value()}}} again! 18 19 19 I think ''get_db_prep_lookup()'' should call ''get_db_prep_value()'' always with prepared == True.20 {{{ 20 I think {{{get_db_prep_lookup()}}} should call {{{get_db_prep_value()}}} always with {{{prepared == True}}}. 21 {{{#!python 21 22 elif lookup_type in ('exact', 'gt', 'gte', 'lt', 'lte'): 22 23 return [self.get_db_prep_value(value, connection=connection, prepared=True)] … … 25 26 }}} 26 27 27 This bug is still unnoticed because in standard ORM ''get_db_prep_lookup()'' always calls with prepared == True.28 This bug is still unnoticed because in standard ORM {{{get_db_prep_lookup()}}} always calls with {{{prepared == True}}}.