Skip to content

Commit 9b263c6

Browse files
committed
[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
1 parent 9944d8d commit 9b263c6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

django/db/models/fields/structures.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
from django.db.models.fields import Field
2+
3+
4+
class ListField(Field):
5+
def __init__(self, field_type):
6+
self.field_type = field_type
7+
super(ListField, self).__init__()
8+
9+
def get_prep_lookup(self, lookup_type, value):
10+
return self.field_type.get_prep_lookup(lookup_type, value)
11+
12+
def get_db_prep_save(self, value, connection):
13+
return [
14+
self.field_type.get_db_prep_save(o, connection=connection)
15+
for o in value
16+
]
17+
18+
def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
19+
return self.field_type.get_db_prep_lookup(
20+
lookup_type, value, connection=connection, prepared=prepared
21+
)

0 commit comments

Comments
 (0)