Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #69218

meta language to define forms

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <fred.sells@adventistcare.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.009
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'syntax': 0.04; 'elegant': 0.07; 'users,': 0.07; 'etc).': 0.09; 'forms,': 0.09; 'subject:language': 0.09; 'suggestions.': 0.09; 'python': 0.11; 'language.': 0.14; 'sections': 0.14; '(1,': 0.16; '(2,': 0.16; '(3,': 0.16; 'displayed.': 0.16; 'layout,': 0.16; 'meanwhile': 0.16; 'flexibility': 0.16; 'language': 0.16; 'code.': 0.18; 'trying': 0.19; 'thanks.': 0.20; 'to:name:python-list@python.org': 0.22; 'button,': 0.24; 'parse': 0.24; 'text,': 0.24; 'define': 0.26; 'asking': 0.27; 'tried': 0.27; 'idea': 0.28; 'xml': 0.29; "i'm": 0.30; 'coded': 0.31; 'file': 0.32; 'class': 0.32; 'front': 0.32; 'quite': 0.32; '(i.e.': 0.33; 'totally': 0.33; 'actual': 0.34; 'skip:d 20': 0.34; 'problem': 0.35; 'basic': 0.35; 'classes': 0.35; 'tool': 0.35; 'something': 0.35; 'editor': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; 'i.e.': 0.36; 'patient': 0.36; 'entry': 0.36; 'should': 0.36; 'too': 0.37; 'to:addr:python-list': 0.38; 'anything': 0.39; 'to:addr:python.org': 0.39; 'enough': 0.39; 'received:org': 0.40; 'users': 0.40; 'invest': 0.60; 'radio': 0.60; 'lost': 0.61; 'course': 0.61; 'information': 0.63; 'more': 0.64; 'management': 0.65; 'biggest': 0.67; 'close': 0.67; 'content,': 0.68; 'generated.': 0.68; 'rendering': 0.68; 'results': 0.69; 'legal': 0.71; 'vital': 0.78
From "Sells, Fred" <fred.sells@adventistcare.org>
To "python-list@python.org" <python-list@python.org>
Subject meta language to define forms
Thread-Topic meta language to define forms
Thread-Index Ac9J/MwrTugTEv1iQa6rw3WVxFKSWw==
Date Thu, 27 Mar 2014 20:56:56 +0000
Accept-Language en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
x-originating-ip [192.168.218.38]
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
MIME-Version 1.0
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8632.1395953860.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1395953860 news.xs4all.nl 2830 [2001:888:2000:d::a6]:51740
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69218

Show key headers only | View raw


I'm trying to use python classes and members to define complex data entry forms as a meta language

The idea is to use a nice clean syntax like Python to define form content, then render it as HTML but only as a review tool for users,  The actual rendering would go into a database to let a vendor's tool generate the form in a totally non-standard syntax that's really clunky.

I don't have a lot of time or management support to do something elegant like XML and then parse it, I'm thinking more like

Class  FyFormNumber001(GeneralForm):
	Section1 = Section(title="Enter Patient Vital Signs")
		Question1 = NumberQuestion(title="Enter pulse rate", format="%d3")
		Question2 = Dropdown(title="Enter current status")
		Question2.choices = [ (1, "Alive and Kicking"), (2, "Comatose"), (3, "Dead"), ...]


Of course this is not quite legal python and I have a lot of flexibility in my "meta" language.  The basic model is that a single file would define a form which would have one or more sections,  each section would have one or more questions of various types (i.e. checkbox, radio button, text, etc).  Sections cannot be nested.

I don't have to have a perfect layout, just close enough to get the end users to focus on what they are asking for before we generate the actual code.  I tried an HTML WYSIWYG editor but that was too slow and I lost information that I need to retain when the actual form is generated.

The biggest problem (to me) is that I have to maintain the order; i.e. the order in which they are coded should be the order in which they are displayed.

I'm looking to do about 200 forms, so it is reasonable to invest some time up front to make the process work; meanwhile management wants results yesterday, so I have a trade-off to make.

Is there anything out there that would be close or do you have any suggestions.

Thanks.

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

meta language to define forms "Sells, Fred" <fred.sells@adventistcare.org> - 2014-03-27 20:56 +0000
  Re: meta language to define forms alex23 <wuwei23@gmail.com> - 2014-03-28 16:37 +1000

csiph-web