Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tool to generate mustache templates #18

Closed
5 tasks done
sheppard opened this issue Sep 17, 2015 · 0 comments
Closed
5 tasks done

tool to generate mustache templates #18

sheppard opened this issue Sep 17, 2015 · 0 comments
Milestone

Comments

@sheppard
Copy link
Member

As discussed in wq/wq#18, it would be nice to be able to have templates generated automatically based on the current model configuration.

Here's how I envision making this work:

  1. Create template snippets for common field types (text, date, number, <input type=radio> for choice, <select> for foreign key)
  2. Create a wq.start tool that reads an XLSForm and assembles a model class and an *_edit.html template (and the detail and list templates for good measure). The template would be generated once and placed in the templates/ folder so it could be customized and compiled into the offline app.
  3. Create a wq.start tool that creates the same templates based off of a registered model. Reference the serializer fields rather than model fields since the serializer is what's actually processing the form, and it may have more/fewer fields than the model. (EDIT: split out from previous step)
  4. Eventually, figure out a way to update (or at least validate) existing templates when new fields are added - e.g. "Your template is missing an <input> for the field ..." moved to tool to validate templates #23
  5. Introduce an option in ./deploy.sh (or a similar process) to automatically generate and/or update templates during every build. This would facilitate the quick creation of simple CRUD applications that only need a model (like how the Django admin works).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant