I'm trying to update an audit log table called 'loggings', here is the
definition of the corresponding model:
class *Logging*(Base):
__tablename__ = 'loggings'
id = Column(GUID(), primary_key=True, nullable=False, default=uuid4)
target_id = Column(GUID(), doc="The ID of the altered ob
Oh right, I've used the @property decorator before, just been a while.
Thanks for the explanation of @hybrid_property. Makes sense.
On Wed, Jun 7, 2017 at 5:32 PM, mike bayer wrote:
>
>
> On 06/07/2017 06:19 PM, Greg Silverman wrote:
>
>> Thanks, it worked!
>>
Thanks, it worked!
I tried something similar using the @hybrid_property decorator, but could
not get it to work. What exactly is the difference between that and the
@property decorator?
Greg--
On Wed, Jun 7, 2017 at 5:08 PM, mike bayer wrote:
>
>
> On 06/07/2017 02:31 PM, GMS wrote:
Hi,
Thanks for pointing that out. It's still throwing the same error, even when
changed. Does not seem to like passing the column name to the
column_property method.
Greg--
On Wed, Jun 7, 2017 at 3:30 PM, Jonathan Vanasco
wrote:
> These are two different lines of code. The second o
Yes, I can certainly do that. Sounds pretty simple, actually. I may have
more questions as I dive into this.
Thanks!
On Mon, Apr 24, 2017 at 3:06 PM, mike bayer
wrote:
>
>
> On 04/24/2017 03:42 PM, Greg Silverman wrote:
>
>> My naive first response would be that I want
on, Apr 24, 2017 at 12:21 PM, mike bayer
wrote:
>
>
> On 04/24/2017 12:51 PM, Greg Silverman wrote:
>
>> Hi Mike,
>> I'm finally getting to this. Instead of having both a detail and grouped
>> methods, I would like to have only the grouped method. I'm not su
you please elaborate a bit how these would work within context of the
class?
Thanks!
Greg--
On Wed, Mar 1, 2017 at 8:53 PM, mike bayer wrote:
>
>
> On 03/01/2017 08:27 PM, GMS wrote:
>
>> I have the following class models:
>>
>>
>> | class DiagnosisDetail(Model)
/01/2017 10:22 PM, Greg Silverman wrote:
>
>>
>>
>> On Wed, Mar 1, 2017 at 8:53 PM, mike bayer > <mailto:mike...@zzzcomputing.com>> wrote:
>>
>>
>>
>> On 03/01/2017 08:27 PM, GMS wrote:
>>
>>
ps(sorted_list_of_diagnosis_detail):
>
> for (dx_code, patient_id), details in
> itertools.groupby(sorted_list_of_diagnosisdetail, keyfunc):
> diagnosis_group = DiagnosisGroup(
>dx_code, patient_id
> )
> diagnosis_grou
I should add: The specific queries I was running that were throwing the
error all worked using your test case setup.
Greg--
On Fri, Nov 11, 2016 at 10:50 AM, Greg M. Silverman wrote:
> Hi Mike,
> Modifications of your test made to point to the actual database file I am
> using wo
more.
Interesting.
Thanks!
Greg--
On Thu, Nov 10, 2016 at 8:33 PM, mike bayer
wrote:
>
>
> On 11/10/2016 08:10 PM, horcle_buzz wrote:
>
>> I am using SQLAlchemy and am having an issue wrt to an SQLite error:
>>
>>
>> |
>> SQLiteDatetype only accepts Pythond
Unfortunately, the data are out of our control. However, this solution
looks like it will do the job.
Thanks!
Greg--
On Mon, Jun 6, 2016 at 5:54 PM, Mike Bayer wrote:
>
>
> On 06/06/2016 11:21 AM, Horcle wrote:
>
>> I have the following models:
>>
>> class LabR
in_criteria[1:]:
query = query.join(eval(table), eval(criterion))
Where the variables table and criterion were built lists, so that I ended
up doing a Cartesian product of all my tables, which was giving me many
problems, with aliasing being the least of it!
Thanks!
Greg--
On Tue, Mar 24, 2015 at 11:22
Hi Jonathan,
For the record, in my current setup, I installed python via Homebrew. Prior
to that, I was using the Apple build of python, which would have been the
32-bit version that came with Lion.
Greg--
On Mon, Sep 8, 2014 at 6:31 PM, Jonathan Vanasco
wrote:
> Looking at that issue,
I think I am going to dump SQL Server and just go with Postgres. Much
easier, and less of a headache. Fortunately, we are not yet in production.
Thanks!
Greg--
On Thu, Sep 4, 2014 at 8:31 PM, Horcle wrote:
> Thanks. I forgot to mention that I had tried adding the encoding scheme
SELECT default_schema_name FROM
sys.database_principals
WHERE name = ?
AND type = 'S'
On Mon, Aug 18, 2014 at 9:47 AM, Horcle wrote:
> On Friday, August 15, 2014 8:28:41 PM UTC-5, Michael Bayer wrote:
>>
>>
>> On Aug 15, 2
print 'A'
Again, I am connecting fine with the database create.engine method (that is
'42' is printing as expected), but when I run the inspector.get_table_names
method with the given conditional it is printing the 'A' (I have tried
other table names in the sam
I'm trying to get a series of datetimes using func.datetime. The format of
input is func.datetime(basetime, '+ NNN seconds'), which works nicely if
the shift applied is constant. However I need to add 10, 20, 30 seconds,
etc to this base time. So I want something like func.datetime(basetime,
co
Is it possible to remove mapper events? Specifically I want to call
event.remove(mapper, 'mapper_configured', fn) but I get an error back
saying Mapper is not iterable.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this gro
I'm writing an application that uses kivy for GUI and sqlalchemy for ORM.
Each has its own instrumentation system, and I initially planned to connect
them by 1) mirroring relevant SA attributes in kivy at init, 2) work with
only the kivy versions of the attributes for the duration of the app, 3)
= relationship("A")
> b = relationship("B")
>
> class B(Base):
> __tablename__ = 'table_b'
> id = Column(Integer, primary_key=True)
> ab = relationship('AB',
> collection_class=attribute_mapped_collection(
I created a class CorrelatedProxy inheriting from AssociationProxy that
allows the creator function to depend on the owner instance of the
association proxy. Essentially it gets a attribute 'correlator' of the
something like lambda x: lambda y, z: Constructor(x, y, z), and then
intercepts the _
>
> s = Session(e)
>
> a1 = A()
> a2 = A(parent=a1)
> a3 = A(parent=a1)
> a4 = A()
>
> b1 = B(id=1, a_re=a1)
> b2 = B(id=1, a_re=a2)
> b3 = B(id=1, a_re=a3)
> b4 = B(id=1, a_re=a4)
>
> b5 = B(id=2, a_re=a1)
> b6 = B(id=2, a_re=a2)
> b7 = B(id=2, a_re=
ary" an aliased SELECT statement, or in 0.9
> maybe it can be a a JOIN, that represents all the intermediary rows. Might
> work, might not, would have to spend a few hours with it.
>
> Is there a reason you can't just route to the related B.a.children.bsusing
> proxies?
Consider these 2 mapped classes
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.orm.session import sessionmaker
from sqlalch
Right now query.order_by(composite) gives a sqlite3 operational error,
because the rendered SQL is ORDER BY (composite_val1, composite_val2,
composite_val3) instead of ORDER BY composite_val1, composite_val2,
composite_val3. (The parenthesis is causing an error)
For example, consider the code b
Awesome! The changes should be able to cover the issue.
On Saturday, June 8, 2013 12:40:51 PM UTC-5, Michael Bayer wrote:
>
>
> On Jun 8, 2013, at 1:33 AM, Greg Yang >
> wrote:
>
> > if __name__ == '__main__':
> > engine = create_engine('sqlite:
Right now a filter clause AssociationProxy == None
Consider the following code:
from sqlalchemy.engine import create_engine
from sqlalchemy.ext.associationproxy import association_proxy
from sqlalchemy.ext.declarative.api import declarative_base
from sqlalchemy.orm import relationship
from sqlal
Hi,
I was naively trying to clear a db earlier in the day and I ran into this
problem: 'Cannot delete or update a parent row: a foreign key constraint
fails'
So as anyone would do I've been searching online and through the
documentation on how to turn the foreign keys off, on delete = Cascade,
Excellent. Thanks very much.
--
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 to
sqlalchemy+unsubscr...@googlegroups.com.
For more option
Hi All,
I'm new to sqlalchemy. I've been reading the documentation and group
archives, but can't really find an answer to my question. I suspect
it's a question of terminology, and that I don't really know the term
for what I'm looking for.
Can I map a nested list to one column, and have my nest
I just noticed that part of this has been answered yesterday. I
apologize for the redundancy; I did not think I had posted the earlier
request.
--greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlal
our help. I'm looking forward to learning more about all
of this!
--greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@goo
, metadate, engine, autoload_with=engine)
B = Table('Table_B', metadate, engine, autoload_with=engine)
Now, how do I go about creating a link, say A_id, from table 'B' to
table 'A.id'
Thanks for your help!
--greg
--~--~-~--~~~---~--~~
Y
The commit mentioned earlier fixed the issue. Thanks for all the help.
--~--~-~--~~~---~--~~
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 unsubscrib
Thanks, I'll try this out and let you know how it goes.
On Jan 23, 12:43 pm, Rick Morrison wrote:
> Uh, did you guys not see my last message in this thread?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchem
Yeah, I can get it to you, but in the reply box I'm not seeing
anything here about attachments. There's just Send, Discard, Add Cc,
or Edit Subject. I am set up to use this group only through the
browser.
On Jan 23, 12:35 pm, Don Dwiggins wrote:
> Greg wrote:
> > I think I f
I think I found one that might help. Where can I upload this HTML file
it generated?
On Jan 22, 12:57 pm, Don Dwiggins wrote:
> Greg wrote:
> > Unfortunately, I'm connecting remotely via iODBC and do not have said
> > tools. I'm running Ubuntu Linux, if you know of an
Unfortunately, I'm connecting remotely via iODBC and do not have said
tools. I'm running Ubuntu Linux, if you know of any way to get the
same thing prettied up, let me know and I will.
On Jan 21, 12:22 pm, Don Dwiggins wrote:
> Greg wrote:
> > As a disclaimer, this is a legac
As a disclaimer, this is a legacy system in which I have no control
over, so what you are about to see is pretty disturbing :)
http://pastebin.com/m10d49ac1
The formatting is pretty crazy, I'm hoping you can make use of this.
--~--~-~--~~~---~--~~
You received thi
#x27;tb_FSAR_Data_SampArtReq', meta, autoload=True,
autoload_with=engine)
On Jan 21, 1:14 am, Michael Bayer wrote:
> yeah i meant send along the CREATE TABLE to the mailing list here.
> or a describe, whatever shows us what column type might be failing.
>
> On Jan 20, 2
How do I go about doing this? Showing the create table?
On Jan 20, 4:54 pm, Rick Morrison wrote:
> > I'm just trying to introspect an existing production database, not
> > create any new tables.
>
> The structure of the table is read when reflecting the table: it's likely
> that an unusual colum
n Jan 20, 2009, at 4:20 PM, Greg wrote:
>
>
>
> > I've got the following code to reflect an MS SQL 8 database using the
> > latest stable pyodbc, python 2.5, and SQLAlchemy 5.1:
>
> > engine = create_engine('mssql://userXXX:pass...@mydsn', echo=False)
I've got the following code to reflect an MS SQL 8 database using the
latest stable pyodbc, python 2.5, and SQLAlchemy 5.1:
engine = create_engine('mssql://userXXX:pass...@mydsn', echo=False)
meta = MetaData()
meta.bind = engine
artreqs = Table('tb_FSAR_Data_SampArtReq', meta, autoload=True,
aut
_zero().primary_key))
File "/opt/local/lib/python2.5/site-packages/SQLAlchemy-0.5.0rc3-
py2.5.egg/sqlalchemy/orm/query.py", line 241, in _only_mapper_zero
raise sa_exc.InvalidRequestError("This operation requires a Query
against a single mapper.")
InvalidRequestError: This o
I noticed current release information is now available on the
SQLAlchemy homepage! Good job!
Greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, sen
m now using, "except (sa.exceptions.DBAPIError,
cx_Oracle.DatabaseError), e:". While I don't like having the
cx_Oracle exception in there, at least I have explicit handling with
the unknown/unexpected case broken out now.
Greg
P.S. Keep up the good work guys!
On Apr 2, 5:06 pm, Mich
ask your
question. Hopefully the author will be able to better address your
questions/concerns.
Greg
On Apr 2, 6:02 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> thats great. we are going to be checking in some code soon that will
> look for alternate database modules via pkg_reso
perly imported. If you don't want to wait for the next release,
search the google group and you'll find the proper hook file contents.
Hope this isn't too much of a commercial.
Greg
--~--~-~--~~~---~--~~
You received this message because you are subs
database and retry, I can try that
later this week. My DB server is a shared server so shutting it down
for the whole group is not well receieved. ;)
> Paul
Greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On Apr 2, 12:36 pm, Paul Johnston <[EMAIL PROTECTED]> wrote:
> Greg,
>
> If you can send the traceback you get when such an error occurs, that
> would be helpful for providing Oracle support for this condition.
>
> Paul
>
I assume this means that the exception is n
ns exist within the cool;
having been previously reaped. Application attempts to query
database. What does SA return? In this case, it should know it does
not have any connections within its pool. Is this documented?
Is there any documention which describes the known failure modes which
SA detects?
Frankly I'm very surprised this class of error has not been previously
addressed.
I'll have to test and see what happens. I was planning on doing the
defensive coding, followed by the testing to make sure it is caught
and recovers correctly.
Greg
On Apr 2, 12:36 pm, Paul Johnst
lem has already been
addressed.
Just some food for thought.
Greg
On Apr 2, 12:33 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> releases are announced on this mailing list as well as the Python
> cheeseshop (and all feeds which aggregate it, such as planet
> python). you can al
QLAlchemy right now, assuming the DBAPI actually
returns an exception?
Greg
>
> On Apr 2, 2007, at 1:07 PM, Greg Copeland wrote:
>
>
>
> > I'm using sqlalcehmy 2.5 with cx_Oracle 4.2.1. What is the proper way
> > to detect an sqlalchemy operation has lost its dat
Perhaps I missed it, but it would be great if you guys would update
the Latest News section on the SA homepage when a new release is made
available.
Greg
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlal
n? If not, what exception will user code see?
I found that various threads on automatic reconnection and I assume SA
does not currently, reliably, support automatic database reconnection?
Greg
--~--~-~--~~~---~--~~
You received this message because you are subscri
could test this by driving your
application with a set of fixed inputs.
One of the gotchas of using psyco is memory use goes through the roof
in exchange for much improved performance.
Greg
On Mar 21, 10:49 am, "Andrew Stromnov" <[EMAIL PROTECTED]> wrote:
> Usi
Great that's working. And Yuck! Having to do that directly on the
cursor really makes me enjoy SA's capabilities. Can't wait until
that's a supported feature. Keep up the good work guys!
Greg
On Mar 9, 10:42 am, "Michael Bayer" <[EMAIL PROTECTED]> wrote:
for now theres not really a good way to make it happen within SA's
> querying facilities; youd have to drop into cx_oracle to do it.
Dang it. I was afraid of that. How do I grab the cx_Oracle cursor
from SA?
Thanks,
Greg
--~--~-~--~~~---~--~~
You re
racle function via the func
method, which also has output parameters? Are they even supported?
Function blah looks something like:
create or replace function blah( arg1 IN VARCHAR2(15), arg2 IN
INTEGER, arg3 IN INTEGER, arg4 OUT NOCOPY VARCHAR2 ) RETURN INTEGER
...
61 matches
Mail list logo