Changeset 601
- Timestamp:
- 09/02/05 11:34:14 (3 years ago)
- Files:
-
- django/trunk/django/core/meta/__init__.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/meta/__init__.py
r579 r601 300 300 if self.has_related_links: 301 301 # Manually add RelatedLink objects, which are a special case. 302 core= get_module('relatedlinks', 'relatedlinks')302 relatedlinks = get_module('relatedlinks', 'relatedlinks') 303 303 # Note that the copy() is very important -- otherwise any 304 304 # subsequently loaded object with related links will override this 305 305 # relationship we're adding. 306 link_field = copy.copy( core.RelatedLink._meta.get_field('object_id'))306 link_field = copy.copy(relatedlinks.RelatedLink._meta.get_field('object_id')) 307 307 link_field.rel = ManyToOne(self.get_model_module().Klass, 'id', 308 308 num_in_admin=3, min_num_in_admin=3, edit_inline=TABULAR, 309 309 lookup_overrides={ 310 310 'content_type__package__label__exact': self.app_label, 311 'content_type__python_module_name__exact': self.module_name 311 'content_type__python_module_name__exact': self.module_name, 312 'object_id__id__exact': None, 312 313 }) 313 rel_objs.append(( core.RelatedLink._meta, link_field))314 rel_objs.append((relatedlinks.RelatedLink._meta, link_field)) 314 315 self._all_related_objects = rel_objs 315 316 return rel_objs … … 1533 1534 params[f.column] = f.get_manipulator_new_data(rel_new_data, rel=True) 1534 1535 # Related links are a special case, because we have to 1535 # manually set the "content_type_id" field.1536 # manually set the "content_type_id" and "object_id" fields. 1536 1537 if opts.has_related_links and rel_opts.module_name == 'relatedlinks': 1537 1538 contenttypes_mod = get_module('core', 'contenttypes')
