[sqlalchemy] dynamic columns

2008-11-18 Thread g00fy
hi so i have list of languages (suffixes) en de pl ru etc... now i have my article_table, when normaly i would have columns: id, title, content but now i want to have: id, title_en, title_de, title_pl, title_ru,,content_en,..,content_ru how can i create table definition dynamicly

[sqlalchemy] Re: multilingual content / multiple currencies (prices)

2008-11-15 Thread g00fy
objects with one attr per object kills it, i've no idea about my 100K+ objects with average 5 attrs per object... ciao svil On Wednesday 12 November 2008 23:43:08 g00fy wrote: I already implemented your solution: Book : table with general data id, isbn, category_id

[sqlalchemy] Re: multilingual content / multiple currencies (prices)

2008-11-12 Thread g00fy
2008 00:43:00 g00fy wrote: What is the best way to store content in multiple languages (translations) ? The same question about the prices in multiple currencies ? The problem: World Wide Book Shop (collection of books from multiple countries in multiple currencies

[sqlalchemy] multilingual content / multiple currencies (prices)

2008-11-11 Thread g00fy
What is the best way to store content in multiple languages (translations) ? The same question about the prices in multiple currencies ? The problem: World Wide Book Shop (collection of books from multiple countries in multiple currencies and languages) Model: ## Book

[sqlalchemy] relation, primaryjoin, uselist=False How to LIMIT to 1?

2008-10-17 Thread g00fy
hi, on Mapper() i have relation() i use primaryjoin, and uselist=False, but i also want to have LIMIT=1 on my join it would be much faster!! SA should add the limit itself when uselist=False --~--~-~--~~~---~--~~ You received this message because you are

[sqlalchemy] Re: relation, primaryjoin, uselist=False How to LIMIT to 1?

2008-10-17 Thread g00fy
), ), rest relations an aditional subselect will just make it work slower. On 17 Paź, 21:57, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 17, 2008, at 3:32 PM, g00fy wrote: hi, on Mapper() i have relation() i use

[sqlalchemy] duplicated sql ? - why?, speeding up relations (slow)

2008-10-16 Thread g00fy
I have loads of related fields in my model. I set up lazy = False where i had to and i don't know why SA keeps duplicating (aliasing) my tables, so i fetch my data twice (2 times more column that i realy need) i send my model and mappings and the sql code SA is querying. models:

[sqlalchemy] Re: duplicated sql ? - why?, speeding up relations (slow)

2008-10-16 Thread g00fy
So in simple words, how do I speed this up? On 16 Paź, 18:42, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 16, 2008, at 12:31 PM, g00fy wrote: I have loads of related fields in my model. I set up lazy = False where i had to and i don't know why SA keeps duplicating (aliasing) my

[sqlalchemy] Re: duplicated sql ? - why?, speeding up relations (slow)

2008-10-16 Thread g00fy
, 23:03, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 16, 2008, at 1:23 PM, g00fy wrote: I do have correct results, but this is veryslow. I assume that I have to query(Model) whitout any relations and then eagerload or join or whatever that will make this work for me. Am i right

[sqlalchemy] similar to composite()

2008-10-13 Thread g00fy
I have my table Warehouse collumns like: id, owner_id , area_total, area_office ... ,area_storage I would like to have acces to all areas by Warehouse.area.property: example: Warehouse.area.storage I did composite(), but now I can't filter like: filter(Warehouse.area.total =100) and even

[sqlalchemy] Re: similar to composite()

2008-10-13 Thread g00fy
How this Proxy object is going to work exacly? Will that generate extra Sql or what? I assume that I should just change __getattr__() to desired and return Warehouse.key ? or warehouse_table.c.key? On 13 Paź, 17:25, Michael Bayer [EMAIL PROTECTED] wrote: On Oct 13, 2008, at 11:14 AM, g00fy

[sqlalchemy] Re: how to set up proper filter by related?

2008-10-03 Thread g00fy
dum question, i just noticed any() in the docs , sorry On 3 Paź, 23:08, g00fy [EMAIL PROTECTED] wrote: i have a problem with filtering by related problem - i want to find estates that translated title is warehouse here are the models: from estate.model import meta from sqlalchemy import

[sqlalchemy] how to set up proper filter by related?

2008-10-03 Thread g00fy
i have a problem with filtering by related problem - i want to find estates that translated title is warehouse here are the models: from estate.model import meta from sqlalchemy import Table, Column, Integer, String, ForeignKey, Unicode from sqlalchemy.orm import mapper, relation, backref

[sqlalchemy] Re: Relations - How?

2008-09-23 Thread g00fy
):         self.session.commit()         self.session.close() app.close() On Sep 22, 10:25 pm, g00fy [EMAIL PROTECTED] wrote: I have this problem with setting relations with specific models: Book : isbn - integer translations - many translations prices - many prices Translation

[sqlalchemy] Re: Relations - How?

2008-09-23 Thread g00fy
will not be enough. (consider having 30 multiple relations, it will generate huge ammount of data M*n*x*...) On 23 Wrz, 16:37, g00fy [EMAIL PROTECTED] wrote: Thnx a lot Alex! I already love Pylons and SQLAlchemy! On 23 Wrz, 12:16, Alex K [EMAIL PROTECTED] wrote: Hello, here is the answer

[sqlalchemy] Relations - How?

2008-09-22 Thread g00fy
I have this problem with setting relations with specific models: Book : isbn - integer translations - many translations prices - many prices Translation : book - FK to book laguage - FK to Language (oneTOone) title - string Language : code - string name - string Currency : code - string name