Open sharwell opened 11 years ago
More details.
table(relation) ::= <<
CREATE TABLE <relation.Name>
<relation.Columns.Values:col()>
>>
col(col) ::= <<
column <col.Name>
>>
When I look at this in visualizer, I'm guessing it resolves relation.Columns first, which is the Dictionary<string,Column>, and it enumerates the Keys collection. When it tries to resolve .Values it doesn't find it because it has the enumeration results, not the actual object.
And... bingo Not intuitive, and hadn't found anything in the documentation about this:
if (property == null)
value = map[TemplateGroup.DefaultKey];
else if (property.Equals("keys"))
value = map.Keys;
else if (property.Equals("values"))
(in Antlr4.StringTemplate\Misc\MapModelAdaptor.cs)
The adapter expects '.keys' or '.values' in lower-case. You could either change the capitalization there (to align it with c#/.NET conventions) or write a note in the documentation about the case for those properties. I tested it and it works for <rel.Columns.values:col()>
Sam, what's the lookup list for attribute properties? I'm having issues trying to render
Tried passing
dict.Values
to a template and it doesn't find any objects, passingdict
renders the Keys collection.