[sqlalchemy] Turbogears 2.1 breaks with SQLAlchemy 0.7beta
Hello guys, Just an FYI. Due to the change of API in SA0.7 (http://www.sqlalchemy.org/trac/wiki/07Migration#Thesqlalchemy.exceptionsaliasinsys.modulesisremoved) to be exact. The current release of TG is broken, as several packages it uses for example http://dpaste.com/416049/ use the old import. Until this is fixed in TG the solution is to run. pip install -U sqlalchemy==0.6.6 -- 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 sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
[sqlalchemy] [OT] new to macos any db viewer you recommend?
Hello, Will anyone recommend me a nice tool to view/analyze my databases? I normally use the shell and SA but I'm starting a project with an existing db (and heavy on db procedures and trigger) so I'll like to have some sort of GUI to simplify my learning curve. After some searching I found http://code.google.com/p/sequel-pro/ seems nice any alternatives/opinions/known issues? Almost forgot I mostly work with postgre and mysql dbs, and sqlite for development. --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: SQLAlchemy 0.5 Released
On Tue, Jan 6, 2009 at 3:42 PM, Michael Bayer mike...@zzzcomputing.com wrote: Hello list - I am pleased to announce the release of SQLAlchemy 0.5.0, the first official release in the 0.5 series. This series has been in the making since the Pycon 2008 sprints, where we first began reorganizing the ORM attribute system and adding comprehensive rollback and SAVEPOINT support to the session. To really get a sense of what's new, the http://www.sqlalchemy.org/trac/wiki/05Migration document points to most of it, and a good read of the ORM tutorial and the session documentation illustrate the major paradigm shifts of the 0.5 series. The most profound changes are: * Query can now select any combination of entities/columns, ORM enabled or not. * The Declarative approach is widely tested and should be considered a first choice for many applications. * The Session actively expires its state after a commit operation and can revert its internal state after a rollback (all of which is configurable since it results in a lot more SQL being issued). SAVEPOINTs are very usable. * Query's ability to create joins automatically or semi- automatically using query.join() is greatly enhanced. * Query can issue updates and deletes directly based on criterion. * The joined and single table inheritance systems, particularly from a Query perspective, are dramatically improved. * The ORM has many new extension points including AttributeExtension, SessionExtension, and comparator_factory. * The method of configuring schema-level column defaults has been simplified. * The MS-SQL dialect is vastly improved and actively supported thanks to the tireless efforts of Michael Trier. * Speed increases are in the 20% range over 0.4. * The documentation has been converted to Sphinx, and a new searchable API Reference section has been created. * Python 2.3 is no longer supported. The 0.5 series was prereleased through a series of four release candidates over a period of many months, so many production applications are already using the 0.5 series of SQLAlchemy, including Armin Ronacher's new blogging application Zine: http://zine.pocoo.org/ . Also in development is the 0.6 series of SQLAlchemy, which is where we've targeted our dialect overhaul that will allow DBAPIs to interact with database dialects in an agnostic way - this will lead to easy support to backend-agnostic dialects like zxJDBC, mxODBC, pyodbc, as well as alternate dialects like pg8000 which are proving to be faster to the punch in terms of Py3K. Our Py3K support is targeted towards 0.6 where we're anticipating that its DBAPI agnosticism will allow us to mobilize quickly towards new Py3K drivers as they are released. Download SQLAlchemy 0.5 at: http://www.sqlalchemy.org/download.html Migration: http://www.sqlalchemy.org/trac/wiki/05Migration Changelog: http://www.sqlalchemy.org/trac/browser/sqlalchemy/tags/rel_0_5_0/CHANGES Awesome thanks for this. We are going to delay TG2.0b2 a little bit so we can build a new index with SA0.5.0. --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: ANN: Sprox First Beta Release
On Mon, Dec 29, 2008 at 4:26 AM, percious perciou...@gmail.com wrote: Sprox is ready for it's first beta release. Now, this release is 0.5b4 because of sprox's heritage, and therefore it's level of maturity. Sprox has a new website up at www.sprox.org. This site is of course generated with Sphinx, which is the new craze, but includes a considerable amount of auto-generated docs from doctests, and even a way to add comments to each page. In case you are wondering, Sprox is a customizable automated widget generation system that uses database schema and data to generate forms, tables, and other database information in html. Currently, Sprox supports SQLAlchemy, and Toscawidgets for generation. Coverage is at 91% right now, so, beta is appropriate, but we are steaming towards our target of 100%. Sprox can also be found in the recent beta of TG2. It is part of Catwalk, which resides as the admin tab on the default template. So, if you give TG2 a ride, you'll be trying out Sprox too. Sprox is at feature freeze right now until code coverage gets to 10/10, but bug reports are definitely appreciated. They can be reported at http://www.bitbucket.org/percious/sprox/issues/ Awesome, thanks for your work on this Chris, Catwalk2 is great and with this configurability I think we could finally close the gap between SA and html forms. --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: how to build a model package?
On Sat, Dec 20, 2008 at 9:34 AM, Etienne Robillard robillard.etie...@gmail.com wrote: On Wed, 17 Dec 2008 02:48:08 -0600 Jorge Vargas jorge.var...@gmail.com wrote: Hello, I have been trying to figure out an alternative to the following setup. The problem I'm trying to solve is fixing TurboGears project structure but I'm sure this is useful for other projects. model --- __init__.py --- foo.py bar.py in __init__.py we have the initialization of SA, creating mapper/session,etc. then both foo and bar import from model the session metadata, now that we need to initialize (bind several things) SA before using it, the current solution is to provide a function (init_model) that TG itselfs calls when the whole thing is loaded, the side effect this has is that we need to import all classes at the end of the file, which is at best ugly, but really confusing. So my question is, how do you handle a big set of classes that live in their own modules but can be imported directly from the package? Hi Jorge, I'm not sure understanding your question correctly. Do you search for ways to improve your model package based on sqlalchemy.ext.declarative or using classic SA techniques? not really, ideally this shouldn't be tied to any syntax, currently that is all build in in model.__init__.py Either ways, I kinda like making a model package (model.py) free of all the database-related stuff. I prefer putting theses things in database.py, so that its possible to modify the database options independently from the model. I think you got your concept wrong, model.py is a module not a package, a package is a directory with a __init__.py + several modules. If it was just wording yes this is what we are doing now, but we are talking about big models (think 50+ classes) your model.py will become huge and potentially messy, and if you split it into several files you will find that you lose the ability to do from myapp.model import Foo my custom app then look like so: mycustomapp/ - __init__.py - model.py - database.py model.py: from sqlalchemy.schema import MetaData, Table from sqlalchemy.ext.declarative import declarative_base import some_database as db __all__ = ['Base', 'metadata', 'BlogPost'] Base = declarative_base() metadata = MetaData(db.engine) class BlogPost(Base): ... I suppose the declarative_base() and SA 0.5.x greatly simplifies how models gets mapped internally. You can then just import your model class normally: from mycustomapp.model import BlogPost or even: import mycustom.model as model HTH, erob --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: 0.5 release schedule
I just launched last week a site running on 0.5rc4, given the quality of SA releases you shouldn't fear it's not final tag. It's really stable the only thing that could stop you from deploying is a hard policy on what goes to prod, by your organization/company/etc. On Thu, Dec 18, 2008 at 7:54 PM, Michael Bayer mike...@zzzcomputing.com wrote: I have put a site into production using 0.5rc4, and its a fairly prominent site for a popular TV show.0.5.0 is mostly ready to go, I'm holding off on some ORM enhancements to concrete inheritance until 0.5.1 since I need to study them further and concrete inheritance is not a popular feature. So what we're waiting for is a set of enhancements and fixes to the MS-SQL dialect, which will create a change in how URLs work, and then we're good to go. On Dec 18, 2008, at 6:02 PM, David Gardner wrote: I realize this may not be a fair questions since SA is an open source project. With that caveat what is the expected release date for 0.5 final? I have been developing against the 0.5 release candidates, and will probably deploy my code (an internal web app) in the second week of January. If 0.5 is out by then I will install and deploy that on my production server. If 0.5 isn't released I'm wondering if I should deploy my code against 0.4.8 or if I should deploy with 0.5rc4? I am probably more comfortable deploying with 0.5rc4 since that is what I have been developing against, and I am not sure if I have done anything that wouldn't work in 0.4.8. -- David Gardner Pipeline Tools Programmer, Sid the Science Kid Jim Henson Creature Shop dgard...@creatureshop.com --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: iterate_properties missing in 0.5?
On Thu, Dec 11, 2008 at 6:21 PM, Michael Bayer mike...@zzzcomputing.com wrote: On Dec 11, 2008, at 7:08 PM, Jorge Vargas wrote: Hi, has the behavior here http://www.sqlalchemy.org/trac/wiki/FAQ#Whatsthebestwaytofigureoutwhichattributesarecolumnsgivenaclass changed in 0.5? I'm trying that and getting AttributeError: iterate_properties this is my code, so far: klass = model.User def add_user(): obj = klass() this is the error: mapper = class_mapper(klass).columns you want the mapper, not mapper.columns ohhh I totally missed that from the other approach I had, which is a trick, I don't remember where I picked it up which I think only works for declarative. klass.__table__.columns thank you --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] iterate_properties missing in 0.5?
Hi, has the behavior here http://www.sqlalchemy.org/trac/wiki/FAQ#Whatsthebestwaytofigureoutwhichattributesarecolumnsgivenaclass changed in 0.5? I'm trying that and getting AttributeError: iterate_properties this is my code, so far: klass = model.User def add_user(): obj = klass() mapper = class_mapper(klass).columns print mapper,type(mapper) for column in mapper.iterate_properties: raw_input('value for %s'%column) --~--~-~--~~~---~--~~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] How can I reuse the string syntax in my own code?
Hi, I have been working on a little project to transform excel docs (actually them saved as csv files) into SQLAlchemy objects. Of course this is tailored for my own database which I need to import but I have been splitting it into api more and more and eventually plan to release it as some configurable importer for SA. But first I need to clean up the code! currently I have this type of configuration. _excel_to_field = { 'First Name' : 'first_name', 'Last Name' : 'last_name', 'Address' : 'address', 'City' : 'city', 'State' : 'state', 'Zip' : 'zip_code', } and the bulk of the system is run as for k,v in row: if not k in [NoModelField,NoCSVField]: if v: log.debug('Adding Field %s:%s' % (k,v)) else: log.warning('Adding Empty Field for %s at line %i' % (k,index)) setattr(contact,k,v) else: log.warning(Field not accounted for (%s,%s) % (k,v)) so currently that for is very big for (see below) So in order to make code a lot more readable I was thinking I could use the syntax SA uses for filter and such so I can write the _excel_to_field as _excel_to_field = { 'First Name' : 'Contact.first_name', 'Last Name' : 'Contact.last_name', 'Address' : 'Location.address', 'City' : 'Location.city', 'State' : 'Location.state', 'Zip' : 'Location.zip_code', } please note the Location obj is a fabrication of this email but how can I replace the setatrr call? I guess I could parse things around but I assume there is some kind of api in SA to accomplish this. My plan is to add two more parameter to this dict, #1 a typeConverter #2 a headerReader, I'll explain those in due time. I'm working on transforming the forloop into a more elegant forloop with a callback. So the final plan is to have something like this _excel_to_field = { 'First Name' : 'Contact.first_name',string, 'Last Name' : 'Contact.last_name','string', 'Address' : 'Location.address',address, 'City' : 'Location.city',string 'State' : 'Location.state',state 'Zip' : 'Location.zip_code',int } this third callback will be either a build-in, I have several already for date,float,us_money,etc also more complex ones like always create (adds a new record all the time) and query_create (looks for one if that fails create it) fields but you can code your own as they are simply python functions with a common interface. Ideally this will grow into a number big number of defaults that will live inside the package. So you will never have to code it yourself just look for them, but I want to do this string-python formatting First. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: how to query across all fields in an object?
Yes indeed, we are thinking of going with fulltext search but we don't want to tide up the code to a particular backend right now, specially because this is a functionality that isn't critical at this point in time. On Tue, Oct 14, 2008 at 12:17 PM, Michael Bayer [EMAIL PROTECTED] wrote: more elaborate options include, building your own word index table, integrating with an external indexing engine. but looking at the full-text indexing options of the database itself is probably sufficient. On Oct 14, 2:13 pm, Empty [EMAIL PROTECTED] wrote: Also, don't forget the match operator is available on certain backends: sqlite, sql server, oracle, mysql, and postgres. Michael On Tue, Oct 14, 2008 at 1:59 PM, [EMAIL PROTECTED] wrote: this is somewhat frequent question, lookup the group in the past if anyone has something usable. maybe something like query(cls).filter( or_(*[column == value for column in alternatives] )) if many values, use column.in_(values) instead of == alternatives can come from yourtable.columns or classmapper( yourclas).iterate_properties. things to check: - types, e.g. comparing strings and integers may fail or succeed - primary_key = set( c.key for c in class_mapper( cls).primary_key ) - relations/references maybe also be checked via .has/.any e.g. references = [ p for p in classmapper(yourclass).iterate_properties if (p not in primary_key and (not isinstance( p, PropertyLoader) #not a relation or p.use_list == False )) #or a singular reference ] these above are just for example, do your own filtering ciao svil On Tuesday 14 October 2008 20:26:16 Jorge Vargas wrote: Hi, I'm trying to implement a simple search field in my application and I was wondering which will be the best way to implement it on SQLAlchemy. I have googled around and found several partial solutions but none of them convince me of being the right way. My use case is the following. I got a textfield search box which will post a set of words, my webapp is to take those words and do a query in *any* field of the corresponding table, and it is to say within just one table. For example I got a User class that has first_name,last_name,address_fields. And I ran a query for John Thompson, that will bring me back a list of user objects where any of the following is valid, John in first_name, John in last_name, John in address, Thompson in first_name, Thompson in last_name, Thompson in address_field. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Two foreignkey's to the same table, rendering a join error.
On Sun, Oct 5, 2008 at 8:56 AM, Michael Bayer [EMAIL PROTECTED] wrote: you can use strings with Python in them when you use declarative even with args like primaryjoin, so you could say things like: class Policy(DeclarativeBase): __tablename__ = 'policy' policy_state = relation('State',backref='state_policies',primaryjoin=Policy.state_of_policy_code==State.code) domicile_state = relation('State',backref='domicile_policies',primaryjoin=Policy.state_of_domicile_code==State.code) this would eliminate the need to have your classes in a particular order. Its documented about a third of the way down at http://www.sqlalchemy.org/docs/05/plugins.html#plugins_declarative . Thanks for pointing out the string syntax, I must have miss that. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Two foreignkey's to the same table, rendering a join error.
hi I finally made this work. Thanks for the doc link although it wasn't clear enough. As it's using the classical syntax. But the last paragraph of that section gave me a good hint. I have extracted the relevant parts of my model and I got to something that could become a FAQ item or a tutorial or an addition to the docs? The question is which and where? Here is the code. The one thing that still puzzles me is that I had to move my State table declaration before Policy as using State.code or something similar didn't work. class State(DeclarativeBase): __tablename__ = 'state' code = Column(String(2), primary_key=True) name = Column(String(50)) class Policy(DeclarativeBase): __tablename__ = 'policy' id = Column(Integer, primary_key=True) state_of_policy_code = Column(String(2) ,ForeignKey('state.code')) state_of_domicile_code = Column(String(2) ,ForeignKey('state.code')) policy_state = relation('State',backref='state_policies',primaryjoin=state_of_policy_code==State.code) domicile_state = relation('State',backref='domicile_policies',primaryjoin=state_of_domicile_code==State.code) #test code to ran, maybe in a python shell for proper feedback. ny = model.State() ny.code = 'ny' fl = model.State() fl.code = 'fl' p = model.Policy() p.policy_state = ny p.domicile_state = fl model.save(p) model.DBSession.flush()#note this is TurboGears place for SQLAlchemy's session object. ny.state_policies[0].policy_state.code On Fri, Sep 26, 2008 at 9:13 AM, Michael Bayer [EMAIL PROTECTED] wrote: Information on primaryjoin and secondaryjoin is available at: http://www.sqlalchemy.org/docs/05/mappers.html#advdatamapping_relation_customjoin On Sep 25, 2008, at 8:18 PM, Jorge Vargas wrote: hello I'm having a bit of troubles with the following case. http://paste.turbogears.org/paste/8177 This is the error I'm getting. Now I know it has to do with SA not being able to know to which field to map state.id, but how do I fix it? Specify a 'primaryjoin' expression. If this is a many-to-many relation, 'secondaryjoin' is needed as well. % (self)) sqlalchemy.exc.ArgumentError: Could not determine join condition between parent/child tables on relation MappedPolicy.state. Specify a 'primaryjoin' expression. If this is a many-to-many relation, 'secondaryjoin' is needed as well. PS: in case you where wondering for commodity I need those to values present in the table and since they are always going to be two it isn't such a bad design decision... although I may optimize the state table into a python list or dict in the future. I want to know how to fix this. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Two foreignkey's to the same table, rendering a join error.
hello I'm having a bit of troubles with the following case. http://paste.turbogears.org/paste/8177 This is the error I'm getting. Now I know it has to do with SA not being able to know to which field to map state.id, but how do I fix it? Specify a 'primaryjoin' expression. If this is a many-to-many relation, 'secondaryjoin' is needed as well. % (self)) sqlalchemy.exc.ArgumentError: Could not determine join condition between parent/child tables on relation MappedPolicy.state. Specify a 'primaryjoin' expression. If this is a many-to-many relation, 'secondaryjoin' is needed as well. PS: in case you where wondering for commodity I need those to values present in the table and since they are always going to be two it isn't such a bad design decision... although I may optimize the state table into a python list or dict in the future. I want to know how to fix this. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Elixir 0.6.1 released!
On Mon, Aug 18, 2008 at 11:37 PM, Jose Galvez [EMAIL PROTECTED] wrote: I'm not trying to be an ass, but what are the advantages to using Elixer well you did sound like one :) the first thing is that declarative is very new to SA (0.4.something, and only mainstream in 0.5), while elixir has been around since SA0.2(?) next elixir is more featurefull than declarative, for instance it provides you the ability to build custom relationships [1] there was a really nice example somewhere but I can't find it, maybe it's on the video. the other nice feature is giving you a more OOP-ish api, with elixir you can almost forget you are storing to tables. last but not least, you have some nice magic that will take care of your tables Also I believe there is some subclassing/inheritance goodies That said I'm not the best person to answer this because I'm not a heavy elixir user, I just wanted to point out it has a purpose, and if it seems to overlap with SA is because something new was develop and not the other way around. In fact declarative is an extension distributed with SA, not a core feature and it was added so people (including me) stop complaining about how verbose simple projects where [2], on the other hand elixir is an implementation of Active Record and beyond. [1] http://elixir.ematia.de/apidocs/elixir.relationships.html [2] http://groups.google.com/group/sqlalchemy/browse_thread/thread/817097f376fc808b/2e9ac8e83df54090 Gaetan de Menten wrote: I am very pleased to announce that version 0.6.1 of Elixir (http://elixir.ematia.de) is now available. As always, feedback is very welcome, preferably on Elixir mailing list. This is a minor release featuring some bug fixes (one of them to handle a late rename in SQLAlchemy's 0.5 beta cycle), a new, slighty nicer, syntax for providing custom arguments to the column(s) needed for ManyToOne relationships and some exception messages improvements. The full list of changes can be seen at: http://elixir.ematia.de/trac/browser/elixir/tags/0.6.1/CHANGES What is Elixir? - Elixir is a declarative layer on top of the SQLAlchemy library. It is a fairly thin wrapper, which provides the ability to create simple Python classes that map directly to relational database tables (this pattern is often referred to as the Active Record design pattern), providing many of the benefits of traditional databases without losing the convenience of Python objects. Elixir is intended to replace the ActiveMapper SQLAlchemy extension, and the TurboEntity project but does not intend to replace SQLAlchemy's core features, and instead focuses on providing a simpler syntax for defining model objects when you do not need the full expressiveness of SQLAlchemy's manual mapper definitions. Mailing list http://groups.google.com/group/sqlelixir/about --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] How to load a complex data set into an SA aware object?
Hi, I'm working on a project where I got several read only tables that are dependent on a third-party, I got several vainlla SQL queries to get the data I need of them and I was wondering which will be the best way to load them up into SA. The queries themselfs are quite complex with several inner joins and other nasty SQL, the queries don't change except for 1 paramenter I need to pass in which is the root item i'm looking for. I was wondering if there was a way - I could create a class with no Table object that will be populated from the resulting query, - or if I should go with a db view and/or stored procedure, (how will I call that form sa?) - or if I should translate the raw query into SA's sqlexpresions - or should I just bypass SA and do a raw dbapi call? which will be the best way to handle this situation? Keep in mind this data is read-only so the only function I need is getInfo(itemId), which will execute the query and return Table-like object. --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: Microsoft Jet Database Engine
On 11/4/06, Rick Morrison [EMAIL PROTECTED] wrote: Wow, Jet? There's a blast from the past. I would be amazed if you could get 100% of the unit tests to pass, as some of Jet's SQL syntax can vary quite a bit from ANSI standards. Did you use an ODBC connector, DAO or ADO? A general-purpose ODBC connector for SA would be a really nice addition. that will be very nice (the ODBC) think Rick On 11/2/06, hjr [EMAIL PROTECTED] wrote: Hi, I've started on a Jet database engine for sqlalchemy. I've only just started so at the moment it passes 60% of the unit tests. I am doing this because I am limited to a locked down windows machine with only the Jet engine at my disposal! Anyway, if I can get the unit test a bit higher would there be any chance / interest in including this in the SVN code? Thanks Hugh --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~--~~~~--~~--~--~---
[sqlalchemy] Re: CheckConstraint
why not just include formencode support? On 10/27/06, Michael Bayer [EMAIL PROTECTED] wrote: you mean a python-level constraint. id definitely build this as just a callable that takes the whole insert/update criterion and just returns true or false. all the django-niceties are frameworkisms (which folks are free to build, put on the wiki, provide a handy module full of as an extension, etc). On Oct 27, 2006, at 4:40 AM, Alexandre CONRAD wrote: Hello, I was reading about the CheckConstraint documentation, and it looks promising. The examples in the docs are doing contraint with integers. But the cool thing would be able to define you're own contrainsts using ConstraintTypes, or already have pre-defined constraints, ie. EmailConstraint which would just be a some kind of regex matching on a given string. A la django. We could also have custum restrictions based on pre-defined contraints, ie. EmailConstraint(contains=[@mycomp.com, @mycomp.fr]) This would check if the given email is really at a valid email format and check it also contains either the given strings in the constraint. If validation fails, we could catch the Column's name or a list of all failed Columns at the Table level. Regards, -- Alexandre CONRAD --~--~-~--~~~---~--~~ 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 PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy -~--~~~~--~~--~--~---