Skip to content

Instantly share code, notes, and snippets.

@mroig
Last active November 9, 2016 07:58
Show Gist options
  • Select an option

  • Save mroig/c77354d141d9a497909a5f74b6f4ea12 to your computer and use it in GitHub Desktop.

Select an option

Save mroig/c77354d141d9a497909a5f74b6f4ea12 to your computer and use it in GitHub Desktop.
A for that creates a data in xml format for each one of the columns of a query
for i, column in enumerate(columns):
print u' <record model="custom.search.column" id="##SEARCH_ID##_column_{0}">'.format(i)
print u' <field name="sequence" eval="{0}"/>'.format(i*10)
print u' <field name="search_id" ref="##SEARCH_ID##"/>'
print u' <field name="name">{0}</field>'.format(column)
print u' </record>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment