[sqlalchemy] Re: sqlite: copy from one database to another

2008-12-12 Thread rca
log.error("Exception duplicating database to file: %s" % target_file) log.traceback() On Oct 20, 8:24 pm, rca wrote: > Hmm :) > > I am looking for the same thing, I used to do it with sql, but I hoped > to make it more orm > Here is how i do it for s

[sqlalchemy] Re: adding objects to table only once

2008-11-19 Thread rca
I second Eric's opinion, the EntitySingleton is an useful recipy and I used it in SQLAlchemy 5. I think it can be used in your situation well On Nov 18, 6:51 pm, Eric Ongerth <[EMAIL PROTECTED]> wrote: > Faheem, > > On a closely related note, you may find the following 'usage recipe' > interestin

[sqlalchemy] Re: sqlite: copy from one database to another

2008-10-20 Thread rca
Hmm :) I am looking for the same thing, I used to do it with sql, but I hoped to make it more orm Here is how i do it for sqlite def duplicateToDisk(self, file): '''Tohle ulozi databazi, ktera byla pouze v pameti, na disk''' cur = self.connection() import os if os.path.exists(f

[sqlalchemy] Re: enumeration values in the column - referenced from another table

2008-10-03 Thread rca
eate_all() session = Session() doc = Document('jek') t = Token('XXX', surface='AAA') doc.tokens.append(t) t.surface = 'BBB' t.sem = 'xxx' session.add(doc) session.commit() t.surface = 'CCC' doc.tokens.append(Token(pos=1, surface='AAA'

[sqlalchemy] Re: enumeration values in the column - referenced from another table

2008-10-02 Thread rca
2, 3:50 pm, rca <[EMAIL PROTECTED]> wrote: > Thanks again, it is much appreciated > > On Oct 2, 1:03 pm, [EMAIL PROTECTED] wrote: > > > if the tables have nothing in common, u can have a MapperExtension > > that when touching one item updates the proper table.

[sqlalchemy] Re: enumeration values in the column - referenced from another table

2008-10-02 Thread rca
e) It must be something stupid, i will try to come with an example > > ciao > > On Thursday 02 October 2008 13:59:40 rca wrote: > > > thanks for the pointer, I tried and finally managed something the > > synonym (with the big neon "don't panic" in my head) &g

[sqlalchemy] Re: enumeration values in the column - referenced from another table

2008-10-02 Thread rca
value referenced from the other table. Sorry if my questions are stupid! --roman On Oct 1, 10:21 am, [EMAIL PROTECTED] wrote: > maybe try, instead of hiding the conversion inside db-types layer, to > move it upper, i.e. make it a real reference/FK-column to real > object/table, t

[sqlalchemy] enumeration values in the column - referenced from another table

2008-09-30 Thread rca
Hi all, my apologies for a long question, I am new to sqlalchemy and I was struggling with one problem. I solved it but I really not sure it's the right way to do it. The problem is that I need to create objects like this: Token(pos=2, surface="helloWorld") The surface is string, but in the dat