Merge pull request #312 from anssih/fix/ndb-refs

Fix references with GAE in NDB mode
This commit is contained in:
mdipierro
2013-12-01 23:29:14 -08:00
+1 -3
View File
@@ -4839,12 +4839,10 @@ class GoogleDatastoreAdapter(NoSQLAdapter):
elif field_type.startswith('reference'): elif field_type.startswith('reference'):
if field.notnull: if field.notnull:
attr = dict(required=True) attr = dict(required=True)
referenced = field_type[10:].strip() ftype = self.types[field_type[:9]](**attr)
ftype = self.types[field_type[:9]](referenced, **attr)
elif field_type.startswith('list:reference'): elif field_type.startswith('list:reference'):
if field.notnull: if field.notnull:
attr['required'] = True attr['required'] = True
referenced = field_type[15:].strip()
ftype = self.types[field_type[:14]](**attr) ftype = self.types[field_type[:14]](**attr)
elif field_type.startswith('list:'): elif field_type.startswith('list:'):
ftype = self.types[field_type](**attr) ftype = self.types[field_type](**attr)