diff options
| author | Alex Gaynor <alex.gaynor@gmail.com> | 2010-07-20 21:04:51 +0000 |
|---|---|---|
| committer | Alex Gaynor <alex.gaynor@gmail.com> | 2010-07-20 21:04:51 +0000 |
| commit | 9b263c61f805947a06473fd5ca170e8b970aae32 (patch) | |
| tree | 8c3e9b912d3853c042b019bc3f7614587180628d /django/db/models/fields/structures.py | |
| parent | 9944d8d5efbe514e8de1d9adcc316a61fded3b65 (diff) | |
[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
Diffstat (limited to 'django/db/models/fields/structures.py')
| -rw-r--r-- | django/db/models/fields/structures.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/django/db/models/fields/structures.py b/django/db/models/fields/structures.py new file mode 100644 index 0000000000..2d3822e932 --- /dev/null +++ b/django/db/models/fields/structures.py @@ -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 + ) |
