Re: [sqlalchemy] Setting __tablename__ at runtime?

2015-08-19 Thread Frank Horowitz
On Wednesday, August 19, 2015 at 1:24:08 AM UTC-4, Michael Bayer wrote: it doesn't work that way. The tables in your schema are supposed to be fixed. If you want to map a new class to a new table, you can do that with mixins: class Level(object): id = Column(Integer,

[sqlalchemy] Setting __tablename__ at runtime?

2015-08-18 Thread Frank Horowitz
Hi All, A noob question, that I've been struggling with off and on for a while. I'm pretty sure that I'm missing something obvious... I'm creating tables and their entries on the fly programmatically, and need to control the table names. I understand how to define declarative classes as

Re: [sqlalchemy] How can I use the transaction to make sure data is one by on?

2014-07-30 Thread 'Frank Liou' via sqlalchemy
HI! Jonathan I use self.trans = self.connection.begin() but now i use debug lock before commit then i try to use my pgAdmin to add or update same data. and then it's sussesful to add data by pgAdmin i think that meaning my trans did not work and it maybe just can lock the same

[sqlalchemy] How can I use the transaction to make sure data is one by on?

2014-07-29 Thread 'Frank Liou' via sqlalchemy
My question is I want to add some data But what if so many people add in the same time? Is it will error? So Can i that the add code limit in one guy to use when he is add over then release limit code and let other guy to use Thanks for help -- You received this message because you are

Re: [sqlalchemy] Re: Use relationship,can't do session.add (flask)

2014-07-21 Thread 'Frank Liou' via sqlalchemy
i use try if do not return Success it mean have not session.add @app.route('/company/business_account_number/address/company_status/company_captial_amount/business_description/company_name', methods=['POST']) def

[sqlalchemy] Re: Use relationship,can't do session.add (flask)

2014-07-20 Thread 'Frank Liou' via sqlalchemy
there is no error msg or how can i trace the error msg? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com. To post to

[sqlalchemy] Use relationship,can't do session.add (flask)

2014-07-18 Thread 'Frank Liou' via sqlalchemy
when i use relationship my add session will fail is it need do some else to map there's connection? plaese help me flask route code: @app.route('/company/business_account_number/address/company_status/company_captial_amount/business_description/company_name', methods=['POST']) def

[sqlalchemy] same code same database but the not same insert result

2014-07-09 Thread 'Frank Liou' via sqlalchemy
i use flask connect to postgres def post_insert(username): conn = engine.connect() encoded = base64.b64encode(username.encode('utf-8')) puresql = sqla.text(INSERT INTO friends(name) VALUES(:encoded)) conn.execute(puresql,encoded = encoded) i insert username encode with base64 to

[sqlalchemy] Re: same code same database but the not same insert result

2014-07-09 Thread 'Frank Liou' via sqlalchemy
but i mean i encoded 12345678 that should be MTIzNDU2Nzg but \ x4d54497a4e4455324e7a673d the same code why get not the same result? -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails

Re: [sqlalchemy] flask sql cann't insert Variable in VALUES

2014-07-06 Thread 'Frank Liou' via sqlalchemy
Thank you Simon it works that 's amazing you let me open the door thans you again -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it, send an email to

[sqlalchemy] flask sql cann't insert Variable in VALUES

2014-07-04 Thread 'Frank Liou' via sqlalchemy
I try to insert username in to my table it show Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application. it maybe mean no request i try to change username to '123123'

[sqlalchemy] how can i get .engine.execute result?

2014-07-03 Thread 'Frank Liou' via sqlalchemy
def get_query(): conn = engine.connect() check = 'SELECT * FROM friends' obj = [conn.execute(check)] jqs = json.dumps(obj) return jqs result is Internal Server Error The server encountered an internal error and was unable to complete your request. Either the server is

Re: [sqlalchemy] how can i get .engine.execute result?

2014-07-03 Thread 'Frank Liou' via sqlalchemy
Hi Simon thanks for your answer but i can't understand what's fetchall() mean i remove the fetchall() it still work -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To unsubscribe from this group and stop receiving emails from it,

[sqlalchemy] flask + sqlalchemy +postgresql how can i check out the data from my db???

2014-06-30 Thread 'Frank Liou' via sqlalchemy
this is my code . my question is how can i check out the data from my db. i have try query=session.query(Friend) but i think that might be wrong so..what place i have to add the code query=seesion.query(frined)??? p.s. i just the rookie this is my database id | name

[sqlalchemy] flask+python+postgresql sqlalchemy , use create_all() error

2014-06-27 Thread 'Frank Liou' via sqlalchemy
this is my code qqq.py import sys sys.path.append(/var/www/html/ft/ft2) from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy import dbtest app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://frank:1qaz2wsx#EDC@localhost/mydb' db = SQLAlchemy(app

[sqlalchemy] Multiple identical relations in a Many-To-Many-Relationship

2012-08-29 Thread Frank Hempel
that row two times. I would then expect to have the part object two times in the parts-list. But its not. How could I achieve that? Thanks in advance. Best regards, Frank -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion

[sqlalchemy] Re: Multiple identical relations in a Many-To-Many-Relationship

2012-08-29 Thread Frank Hempel
There was a little mistake in the example: The column declaration of the association table should use Integer as type not String. Nevertheless the the example runs :) the same way. So the mistake does not influence the above described behaviour. -- You received this message because you are

Re: [sqlalchemy] Multiple identical relations in a Many-To-Many-Relationship

2012-08-29 Thread Frank Hempel
along the way that would further reduce it's feasability. yes, you are totally right. Deleting just one of the doubles would not be possible at all, hence I should go for a clean db schema. Thanks for your comment! Regards, Frank -- You received this message because you are subscribed

[sqlalchemy] Re: TypeDecorator Problem with basic association pattern

2010-08-26 Thread Frank
Hi Michael, yes, you're right of course. This overlapped with the other issue you mentioned about the nutrient_weight/weight column name. I didn't realize this at once. When I change the column name or the mapping appropriately I don't need to return None anymore. Thanks again Frank -- You

[sqlalchemy] Re: TypeDecorator Problem with basic association pattern

2010-08-25 Thread Frank
the WeightType class with a simple example (Person - weight) it wasn't necessary. Thank you Frank -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send

[sqlalchemy] TypeDecorator Problem with basic association pattern

2010-08-24 Thread Frank
... Here's the full script http://paste.pocoo.org/show/253956/ Many thanks Frank -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email

[sqlalchemy] Re: Many to One relation, correct like this?

2009-04-02 Thread Frank Broniewski
. the brand_id gets populated by the ORM when things are flushed. Frank Broniewski wrote: Hi all, I want to know if I am using SQLAlchemy in a correct and proper way for Many to One Relations between objects and database tables. I have created a test case for Cars and Brands. Each

[sqlalchemy] Many to One relation, correct like this?

2009-04-01 Thread Frank Broniewski
and if the assignement in the car mapper is correct also. Just to be clear, it is working, but I want to know if I use everything correctly here. Many thanks for your comments Frank CODE: #!/usr/bin/python # coding: utf-8 from sqlalchemy import create_engine, Table, Column, Integer, String, MetaData

[sqlalchemy] Re: SQLAlchemy and scrollable cursors

2009-02-20 Thread Frank Millman
syntax. For this to work in SA 0.4 and 0.5, you'll need to add the engine keyword has_window_funcs=1 to your connection string. From what I understand, SA 0.6+ will sniff out the mssql version and automatically toggle the behavior. Rick Thanks for the info - much appreciated. Frank

[sqlalchemy] SQLAlchemy and scrollable cursors

2009-02-18 Thread Frank Millman
to the user, but only select the rows in small chunks, which is a huge performance benefit for very large tables. Does SQLAlchemy have anything built-in to support this concept? Thanks Frank Millman --~--~-~--~~~---~--~~ You received this message because you

[sqlalchemy] Re: msqsql and sqlalchemy on linux -was Re: mssql connection uri

2008-01-24 Thread Frank Wierzbicki
cleanly on CPython 2.3, seems mostly because of differences between 2.3's sets.Set and 2.4+ builtin sets. Also cool. In Jython trunk I think we already have 2.4 style sets on trunk. -Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed

[sqlalchemy] Re: msqsql and sqlalchemy on linux -was Re: mssql connection uri

2008-01-19 Thread Frank Wierzbicki
on your jdbc experiments? -Frank --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups sqlalchemy group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL

[sqlalchemy] Re: msqsql and sqlalchemy on linux -was Re: mssql connection uri

2008-01-19 Thread Frank Wierzbicki
On Jan 19, 2008 1:00 PM, jason kirtland [EMAIL PROTECTED] wrote: Frank Wierzbicki wrote: I'm not too far yet with Jython- still working on CPython issues. This weekend I plan to check in a tool that converts the test suite source into 2.3-compatible syntax, enabling testing with the Jython

[sqlalchemy] Re: Jython and sqlalchemy

2007-07-17 Thread Frank Wierzbicki
On 7/16/07, Michael Bayer [EMAIL PROTECTED] wrote: hey frank - awesome ! i had tried Jython a little bit but had probs getting its 2.3 support happening. glad to hear its able to import sqlalchemy. It certainly continues to have some problems, for example, I think re is missing a few