Files
puppetboard/puppetboard/forms.py
Daniele Sluijters f41dd99f60 puppetboard: Commit the current code.
This is all the code after a week and a bit hacking on this project.
It's in a rather experimental state but should work with a little
effort.
2013-08-07 09:05:31 +02:00

21 lines
622 B
Python

from __future__ import unicode_literals
from __future__ import absolute_import
from flask.ext.wtf import Form
from wtforms import RadioField, TextAreaField, validators
class QueryForm(Form):
"""The form used to allow freeform queries to be executed against
PuppetDB."""
query = TextAreaField('Query', [validators.Required(
message='A query is required.')])
endpoints = RadioField('API endpoint', choices = [
('nodes', 'Nodes'),
('resources', 'Resources'),
('facts', 'Facts'),
('fact-names', 'Fact Names'),
('reports', 'Reports'),
('events', 'Events'),
])