Sync all cached fields on demand. Caution: this operation may be slower.
(self)
| 1423 | return self.document_type._fields.get(member_name) |
| 1424 | |
| 1425 | def sync_all(self): |
| 1426 | """ |
| 1427 | Sync all cached fields on demand. |
| 1428 | Caution: this operation may be slower. |
| 1429 | """ |
| 1430 | update_key = "set__%s" % self.name |
| 1431 | |
| 1432 | for doc in self.document_type.objects: |
| 1433 | filter_kwargs = {} |
| 1434 | filter_kwargs[self.name] = doc |
| 1435 | |
| 1436 | update_kwargs = {} |
| 1437 | update_kwargs[update_key] = doc |
| 1438 | |
| 1439 | self.owner_document.objects(**filter_kwargs).update(**update_kwargs) |
| 1440 | |
| 1441 | |
| 1442 | class GenericReferenceField(BaseField): |