Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'elegant': 0.07; 'users,': 0.07; 'etc).': 0.09; 'forms,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:language': 0.09; 'suggestions.': 0.09; 'python': 0.11; 'jan': 0.12; 'language.': 0.14; 'sections': 0.14; 'thread': 0.14; '(1,': 0.16; '(2,': 0.16; '(3,': 0.16; 'archives?': 0.16; 'displayed.': 0.16; 'layout,': 0.16; 'meanwhile': 0.16; 'pypi?': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'web?': 0.16; 'flexibility': 0.16; 'followed': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'trying': 0.19; 'header:User-Agent:1': 0.23; 'button,': 0.24; 'parse': 0.24; 'text,': 0.24; 'define': 0.26; 'asking': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'idea': 0.28; 'topic': 0.29; '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; 'ago': 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; 'pm,': 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; 'received:173': 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; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: meta language to define forms Date: Thu, 27 Mar 2014 21:32:14 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395970362 news.xs4all.nl 2845 [2001:888:2000:d::a6]:42484 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69232 On 3/27/2014 4:56 PM, Sells, Fred wrote: > 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. Have you searched the python-list archives? PyPI? or the web? There was a thread on this topic perhaps a month ago but I barely followed it. -- Terry Jan Reedy