Re: Keeping python code and database in sync

2014-08-29 Thread dieter
"Frank Millman" writes: > ... > It is a simple matter to write a program that updates the database > automatically. The question is, what should trigger such an update? My first > thought is to use a version number - store a version number in the working > directory, and have a matching number

Re: Keeping python code and database in sync

2014-08-29 Thread Chris Angelico
On Sat, Aug 30, 2014 at 12:14 PM, Skip Montanaro wrote: > Yes, "words" are skipped if they contain anything other than lower > case alphabetic characters. Really simple words = text.split(), then > discard words not meeting the criteria. Easy way to catch a few more: Just .strip() off a few commo

Re: Keeping python code and database in sync

2014-08-29 Thread Skip Montanaro
On Fri, Aug 29, 2014 at 6:54 PM, Ethan Furman wrote: > Thus endeth my attempts to train Skip's Polly. But I am curious -- if > 'suckitude' is in immediate contact with punctuation such as just now, or at > the end of a sentence, does it not count? That would be suckitude indeed! ;) Thank you

Re: Keeping python code and database in sync

2014-08-29 Thread Ethan Furman
On 08/29/2014 04:47 PM, Skip Montanaro wrote: On Aug 29, 2014 5:34 PM, "Chris Angelico" wrote: I'm not sure how suckitude is affected by bugs, exactly; possibly O(N log N), because each bug has a small probability of affecting another bug. OTOH, bug fixes often have a fairly high probability

Re: Keeping python code and database in sync

2014-08-29 Thread Skip Montanaro
On Aug 29, 2014 5:34 PM, "Chris Angelico" wrote: > I'm not sure how suckitude is affected by bugs, exactly; possibly O(N > log N), because each bug has a small probability of affecting another > bug. OTOH, bug fixes often have a fairly high probability of adding more bugs to the system, especial

Re: suckitude classifications [was Re: Keeping python code and database in sync]

2014-08-29 Thread Chris Angelico
On Sat, Aug 30, 2014 at 9:19 AM, Roy Smith wrote: > In article , > Chris Angelico wrote: > >> On Sat, Aug 30, 2014 at 5:02 AM, Ethan Furman wrote: >> > Speaking of suckitude, we could classify technologies that way: >> > >> > xml: major suckitude >> > >> > rpc: no suckitude >> > >> > python: ne

Re: suckitude classifications [was Re: Keeping python code and database in sync]

2014-08-29 Thread Roy Smith
In article , Chris Angelico wrote: > On Sat, Aug 30, 2014 at 5:02 AM, Ethan Furman wrote: > > Speaking of suckitude, we could classify technologies that way: > > > > xml: major suckitude > > > > rpc: no suckitude > > > > python: negative suckitude > > I disagree with your last two qualificatio

Re: suckitude classifications [was Re: Keeping python code and database in sync]

2014-08-29 Thread Chris Angelico
On Sat, Aug 30, 2014 at 5:02 AM, Ethan Furman wrote: > Speaking of suckitude, we could classify technologies that way: > > xml: major suckitude > > rpc: no suckitude > > python: negative suckitude I disagree with your last two qualifications. RPC still sucks, just not as much as some things do. A

Re: Keeping python code and database in sync

2014-08-29 Thread Chris Angelico
On Sat, Aug 30, 2014 at 3:04 AM, Skip Montanaro wrote: > On Fri, Aug 29, 2014 at 9:54 AM, Roy Smith wrote: >> Yeah, schema migration is an ugly problem. > > It's not really any worse than any other sort of complex data > structure change, is it? If your persistent data lived in a pickle > file, i

Re: Keeping python code and database in sync

2014-08-29 Thread Ben Finney
Roy Smith writes: > Yeah, schema migration is an ugly problem. There's a number of tools > to help here, most of which reduce the suckitude, but don't eliminate > it completely. Some things you might want to look at: > > * SQLAlchemy Migrate > * alembic I can strongly recommend SQLAlchemy. It ha

suckitude classifications [was Re: Keeping python code and database in sync]

2014-08-29 Thread Ethan Furman
On 08/29/2014 10:04 AM, Skip Montanaro wrote: On Fri, Aug 29, 2014 at 9:54 AM, Roy Smith wrote: Yeah, schema migration is an ugly problem. It's not really any worse than any other sort of complex data structure change, is it? If your persistent data lived in a pickle file, it would likely be

Re: Keeping python code and database in sync

2014-08-29 Thread Skip Montanaro
On Fri, Aug 29, 2014 at 9:54 AM, Roy Smith wrote: > Yeah, schema migration is an ugly problem. It's not really any worse than any other sort of complex data structure change, is it? If your persistent data lived in a pickle file, it would likely be as bad or worse. > ... suckitude ... Nice word

Re: Keeping python code and database in sync

2014-08-29 Thread Jean-Michel Pichavant
- Original Message - > From: "Roy Smith" > > Yeah, schema migration is an ugly problem. There's a number of tools > to > help here, most of which reduce the suckitude, but don't eliminate it > completely. Some things you might want to look at: > > * SQLAlchemy Migrate > * South (djan

Re: Keeping python code and database in sync

2014-08-29 Thread Roy Smith
In article , "Frank Millman" wrote: > The project is inherently database-driven. The python code expects to find > certain tables and columns in the database. As I develop new features, I > sometimes need to modify the database structure. In the bad old days (like > yesterday) I would just ma

Re: Keeping python code and database in sync

2014-08-29 Thread Chris Angelico
On Sat, Aug 30, 2014 at 12:12 AM, Frank Millman wrote: > 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

Re: Keeping python code and database in sync

2014-08-29 Thread Frank Millman
"Chris Angelico" wrote in message news:captjjmp68kh5zcxq50pi0yeaaapnqotxybg1+f58mv__xd9...@mail.gmail.com... > On Fri, Aug 29, 2014 at 11:31 PM, Frank Millman > wrote: >> Right now I am writing a tool to allow users to view and modify menu >> definitions. The tool is effectively a form definit

Re: Keeping python code and database in sync

2014-08-29 Thread Chris Angelico
On Fri, Aug 29, 2014 at 11:31 PM, Frank Millman 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 w

Re: Keeping python code and database in sync

2014-08-29 Thread Frank Millman
"Chris Angelico" wrote in message news:CAPTjJmrJBciRuterUKWP=qtqxd8xyqum4nx+ofd-twm5oos...@mail.gmail.com... > On Fri, Aug 29, 2014 at 10:42 PM, Frank Millman > wrote: >> It is a simple matter to write a program that updates the database >> automatically. The question is, what should trigger s

Re: Keeping python code and database in sync

2014-08-29 Thread Frank Millman
"Rustom Mody" wrote in message news:1cdf6e52-e09b-40f1-8db1-db6cbbee9...@googlegroups.com... > On Friday, August 29, 2014 6:12:06 PM UTC+5:30, Frank Millman wrote: >> Hi all > >> Now that I have bitten the bullet and published my repository, I am >> forced >> to change my working practices (whi

Re: Keeping python code and database in sync

2014-08-29 Thread Chris Angelico
On Fri, Aug 29, 2014 at 10:42 PM, Frank Millman wrote: > It is a simple matter to write a program that updates the database > automatically. The question is, what should trigger such an update? My first > thought is to use a version number - store a version number in the working > directory, and h

Re: Keeping python code and database in sync

2014-08-29 Thread Rustom Mody
On Friday, August 29, 2014 6:12:06 PM UTC+5:30, Frank Millman wrote: > Hi all > Now that I have bitten the bullet and published my repository, I am forced > to change my working practices (which is a good thing!). > The project is inherently database-driven. The python code expects to find > ce