mirror of
https://github.com/django/django.git
synced 2025-07-04 09:49:12 +00:00
[soc2010/query-refactor] Added a forgotten file from r13441.
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2010/query-refactor@13442 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
9944d8d5ef
commit
9b263c61f8
21
django/db/models/fields/structures.py
Normal file
21
django/db/models/fields/structures.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
from django.db.models.fields import Field
|
||||||
|
|
||||||
|
|
||||||
|
class ListField(Field):
|
||||||
|
def __init__(self, field_type):
|
||||||
|
self.field_type = field_type
|
||||||
|
super(ListField, self).__init__()
|
||||||
|
|
||||||
|
def get_prep_lookup(self, lookup_type, value):
|
||||||
|
return self.field_type.get_prep_lookup(lookup_type, value)
|
||||||
|
|
||||||
|
def get_db_prep_save(self, value, connection):
|
||||||
|
return [
|
||||||
|
self.field_type.get_db_prep_save(o, connection=connection)
|
||||||
|
for o in value
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
|
||||||
|
return self.field_type.get_db_prep_lookup(
|
||||||
|
lookup_type, value, connection=connection, prepared=prepared
|
||||||
|
)
|
Loading…
x
Reference in New Issue
Block a user