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


Groups > comp.lang.python > #77276

Re: Keeping python code and database in sync

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'column': 0.07; 'definitions.': 0.07; 'modify': 0.07; 'subject:code': 0.07; 'table.': 0.07; 'definition,': 0.09; 'inserted': 0.09; 'inserts': 0.09; 'overwrite': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'required,': 0.09; 'works.': 0.09; 'xml.': 0.09; 'python': 0.11; 'stored': 0.12; 'wrote': 0.14; 'creates': 0.14; 'changes': 0.15; 'definition.': 0.16; 'detects': 0.16; 'patches': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'simplest': 0.16; 'skip:n 70': 0.16; 'sure.': 0.16; 'subject:python': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'mechanism': 0.19; 'aug': 0.22; 'adds': 0.24; 'directory.': 0.24; 'instance,': 0.24; 'file.': 0.24; 'order.': 0.26; '(for': 0.26; 'downloaded': 0.26; 'header:X-Complaints- To:1': 0.27; 'idea': 0.28; 'patch': 0.29; 'xml': 0.29; 'sets': 0.30; 'code': 0.31; "skip:' 10": 0.31; 'file': 0.32; 'probably': 0.32; 'run': 0.32; 'quite': 0.32; 'running': 0.33; 'cases': 0.33; 'fri,': 0.33; 'raw': 0.33; 'table': 0.34; "i'd": 0.34; 'problem': 0.35; 'display': 0.35; 'tool': 0.35; 'case,': 0.35; 'definition': 0.35; 'but': 0.35; 'data,': 0.36; 'described': 0.36; 'right?': 0.36; 'scheme': 0.36; 'done': 0.36; 'doing': 0.36; 'expressed': 0.37; 'version,': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'previous': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'how': 0.40; 'such': 0.63; 'field': 0.63; 'more': 0.64; 'effectively': 0.66; 'latest': 0.67; 'frank': 0.68; 'reads': 0.68; 'understand,': 0.84; 'working,': 0.84; 'sitting': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From "Frank Millman" <frank@chagford.com>
Subject Re: Keeping python code and database in sync
Date Fri, 29 Aug 2014 16:12:38 +0200
References <ltpseg$p9m$1@ger.gmane.org> <CAPTjJmrJBciRuterUKWP=QTQXd8xYquM4nx+oFd-TWM5ooskbA@mail.gmail.com> <ltpvb6$16e$1@ger.gmane.org> <CAPTjJmp68Kh5zCXq50pi0yeaaapnQotxYBg1+f58Mv__Xd99Lg@mail.gmail.com>
X-Gmane-NNTP-Posting-Host 197.87.50.124
X-MSMail-Priority Normal
X-Newsreader Microsoft Outlook Express 6.00.3790.4657
X-RFC2646 Format=Flowed; Original
X-MimeOLE Produced By Microsoft MimeOLE V6.00.3790.4913
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.13610.1409321556.18130.python-list@python.org> (permalink)
Lines 51
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1409321556 news.xs4all.nl 2978 [2001:888:2000:d::a6]:59867
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77276

Show key headers only | View raw


"Chris Angelico" <rosuav@gmail.com> wrote in message 
news:CAPTjJmp68Kh5zCXq50pi0yeaaapnQotxYBg1+f58Mv__Xd99Lg@mail.gmail.com...
> On Fri, Aug 29, 2014 at 11:31 PM, Frank Millman <frank@chagford.com> 
> wrote:
>> Right now I am writing a tool to allow users to view and modify menu
>> definitions. The tool is effectively a form definition, which in my 
>> system
>> is expressed in xml and stored in the database in the 'sys_form_defns'
>> table. The raw xml will be uploaded as part of the commit, and will be
>> downloaded when someone pulls the latest version, but it still has to be
>> inserted into the database before it is accessible.
>>
>> It is not a problem - I can use the same mechanism that you described - 
>> but
>> it will be happening quite a lot until the system settles down.
>
> The system I described is intended for cases where each edit builds on
> the previous ones - for instance, if patch 4 creates a table and patch
> 7 adds a column to it, you have to have done them in that order. But
> for that XML data, it sounds as if each update completely overwrites
> all previous ones - is this right? In that case, I'd simplify it:
> after doing all the other patches (anything more complicated than
> "update this one column" can still go through a patching scheme like I
> described), you just hard code an overwrite that sets the appropriate
> field to the current XML. You don't need to update it through all the
> previous states just to get to this one.
>
> Basically, take the simplest approach that will do what you want :)
>

I *think* I understand, but let me restate it in my terms just to be sure.

When I have got this menu definition tool working, I will commit. The files 
involved will probably be one or more 'py' files, and one 'xml' file.

Once downloaded, the 'py' files are automatically 'live', because that is 
how python works. But the xml file will just be sitting in a directory. 
*Something* has to trigger running a program that reads the xml file and 
inserts it into the database.

My idea is to put the 'version number check' in the main program 'start.py'. 
If it detects that an upgrade is required, it will display a warning message 
to the user and then run the upgrade program. The same upgrade program can 
handle both 'schema' changes and (for want of a word) 'meta-data' changes 
such as the menu definition.

Frank


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


Thread

Re: Keeping python code and database in sync "Frank Millman" <frank@chagford.com> - 2014-08-29 16:12 +0200

csiph-web