- Timestamp:
- 06/19/08 11:04:52 (7 months ago)
- Files:
-
- django/branches/newforms-admin (modified) (1 prop)
- django/branches/newforms-admin/django/template/loader_tags.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin
- Property svnmerge-integrated changed from /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-7668 to /django/trunk:1-4345,4350-4357,4359-4365,4371-4372,4374-4377,4380-4386,4388,4390-4391,4400-4402,4404-4408,4410,4412-4419,4426-4427,4430-4432,4434,4441,4443-4444,4446-4447,4450,4452-4453,4455-4458,4476,4503,4546,4564-4569,4580-4586,4617,4630,4641-6390,6392-7706
django/branches/newforms-admin/django/template/loader_tags.py
r7121 r7707 70 70 def render(self, context): 71 71 compiled_parent = self.get_parent(context) 72 pos = 073 while isinstance(compiled_parent.nodelist[pos], TextNode):74 pos += 175 parent_is_child = isinstance(compiled_parent.nodelist[pos], ExtendsNode)76 72 parent_blocks = dict([(n.name, n) for n in compiled_parent.nodelist.get_nodes_by_type(BlockNode)]) 77 73 for block_node in self.nodelist.get_nodes_by_type(BlockNode): … … 84 80 # add this BlockNode to the parent's ExtendsNode nodelist, so 85 81 # it'll be checked when the parent node's render() is called. 86 if parent_is_child: 87 compiled_parent.nodelist[pos].nodelist.append(block_node) 82 83 # Find out if the parent template has a parent itself 84 for node in compiled_parent.nodelist: 85 if not isinstance(node, TextNode): 86 # If the first non-text node is an extends, handle it. 87 if isinstance(node, ExtendsNode): 88 node.nodelist.append(block_node) 89 # Extends must be the first non-text node, so once you find 90 # the first non-text node you can stop looking. 91 break 88 92 else: 89 93 # Keep any existing parents and add a new one. Used by BlockNode.
