1
0
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:
Alex Gaynor 2010-07-20 21:04:51 +00:00
parent 9944d8d5ef
commit 9b263c61f8

View 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
)