Indeed, in my case, it's smarter to put the keys and values in the same
table.
I tried this and it seems to works fine:
from sqlalchemy import Column, Integer, String, ForeignKey, create_engine
from sqlalchemy.orm import relationship, backref, Session
from sqlalchemy.ext.associationproxy import
- "v1"
2 - "v2"
Is it possible to configure SQLAlchemy in order to also delete the values
of the dictionary from the database when the keys are deleted?
I don't know if it can explains something but I am using PostgreSQL.
Thank you for your help!
Sven
--
SQLAl
Hi Mike,
Ok, let's forget everything I said before, it is too confusing.
I propose to start from the *table_per_association* example:
http://docs.sqlalchemy.org/en/latest/_modules/examples/generic_associations/table_per_association.html
Would it be possible to have an attribute
Hello,
Any idea regarding my problems ?
Thank you !
Sven
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve
a). Indeed, a player can get objects from a chest and hold them in
Hands. I can't store Hands.Object into ObjectContainer.objects which would
be only supposed to contain ObjectContainer.Object instances...
Thank you very much.
Sven
--
SQLAlchemy -
The Python SQL Toolkit and Object Relatio
arent
attribute of *Object* linked to *Hands* but I don’t need to have any
list of the objects in *Hands*. Of course, I could ignore that and let
the list be created but it’s a bit dirty
I assume that the answers are pretty simple but I think my comprehension of
the “secondary” parameter
Thank you Mike, it works !
Le samedi 24 février 2018 16:35:57 UTC+1, Mike Bayer a écrit :
>
> On Sat, Feb 24, 2018 at 5:33 AM, Sven <sven@gmail.com >
> wrote:
> > Hello,
> >
> > I have now a small example which illustrates the problem.
> >
>
Thank you Mike.
I'll try that :-) I'll keep you informed.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a
problem you describe and then post an example
> code : http://stackoverflow.com/help/mcve.
>
> Regards
> Gaston
>
>
>
> Le 07/02/2018 à 12:09, Sven a écrit :
>
> Hello everybody,
>
> Today, I have a strange problem regarding relationships.
>
> My projec
nfinite Loops ?
Has someone already see that ? How could I learn more about the problem and
figure out what SQLALchemy is trying to do and where it crashes ?
Thank you.
Sven
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code
It works admirably well. Again, thank you very much for the support you
provide.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See
Hello everybody,
Is it possible to map dictionaries whose keys are objects and the values
simple integers?
I have the following case :
*In the program, there is one instance of "Options" which contains a
dictionary. This dictionary has players as keys and integers as values.
These integers
Thank you for your answers and your explanations ! :-)
It is clear to me, now and I will work on that.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See
What do you mean by "deduplication" ?
I have certainly just a few exotic different type of collection. The others
are standard (lists, dictionaries, ordereddict, etc), but I don't
understand why you are asking that :p
Are you asking that because you think that the solution would be to always
at
it should not append something which was already inserted ?
Thank you very much !
Regards,
Sven
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example.
ind=engine)
session = Session()
south = Exit("south")
west = Exit("west")
e = Exits()
e.exits["south"] = south
e.exits["west"] = west
session.add(south)
Exactly what I was looking for and it works (even applied to my project).
I tried so many things these last days and the solution now looks so simple.
Thank you very much !
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code,
bsolutely clear for me for now. This is
the first time I use SQLAlchemy. Do you think that this method is possible
and is the right way to proceed ?
Le vendredi 20 octobre 2017 20:02:40 UTC+2, Mike Bayer a écrit :
>
>
> CONTINUING ! sorry
>
>
> On Fri, Oct 20, 2017 at 11:55 A
Version of Python : 3.4.0
Version of SQLAlchemy : 1.2.0b2
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a
(jean.name)
Here is what I get :
>>>
Traceback (most recent call last):
File "C:\Users\Sven\Desktop\SQL Alchemy Tests\test2.py", line 10, in
class Stockable(metaclass = MetaBase):
File "C:\Users\Sven\Desktop\SQL Alchemy Tests\test2.py", line 7, in
__init_
).get( (keypart3, keypart2, keypart1) )
which means: I have to change my code every time the ordering of elements
in Python's dictionary changes.
Best wishes for 2015
Sven
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To unsubscribe from
-orders my primary composite
key parts accordingly?
Thanks
Sven
--
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
Aaah Michael,
thanks!
This is awesome!
I tried a lot and all the time I felt that I missed exact this kind of easy
answer. ;)
Thanks again.
Will implement this now.
Sven
Am Dienstag, 30. Dezember 2014 17:01:14 UTC+1 schrieb Michael Bayer:
why don’t you set up your PrimaryKeyConstraint
Hi,
I've got an issue which pops up from time to time with an SQLAlchemy
based webservice application and it revolves around schema changes
happening while an engine with autoload=True has been instantiated and
is being used to start sessions.
What happens is that someone on the team will make a
a column when there's no DDL
change to the table?
I should really try and reproduce the problem first in a controlled
environment to be sure I'm isolating the correct problem.
Cheers,
Sven
On Oct 11, 6:12 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Oct 11, 2010, at 11:17 AM, Sven A. Schmidt
Hi Bryan,
the only tricky bit in your SQL is the dangling 'DAY', because there's
no operator to tie it to the rest. Otherwise you should be able to
write (schema.AppDcRpe2 is just a Table object I'm using as an
example):
q =
Michael,
I hope I'm not misunderstanding what your trying to achieve, but isn't
a combination of like and not like want you want to do here? As in:
create table test (
t varchar2(255)
);
insert into test values ('AA123');
insert into test values ('A0123');
select * from test where t like 'A%'
Just wondering if it's any different if you try the tripe quote syntax
For example in a similar case I use
q =
select
os,
count(os)
from (
select
distinct
s.id,
os
from
server s
join instance_server ins on s.id =
Carl,
the formatting got a bit messed up but if I read your definition
correctly you defined the relation as 'splits'. So you'd want to write
trainingEffor.splits (lower case 's' in splits).
-sas
On Aug 12, 9:20 am, Bleve carl.i.bre...@gmail.com wrote:
I'm using SQLAlchemy 0.6.3 on Python 2.6
but this error looks like something more fundamental may be
wrong.
Does anyone on this list have an idea what I could try to investigate
further? I hope I've included all the relevant infos in this (quite
long, sorry!) mail. Let me know if I can provide anything else!
Cheers,
Sven
--
You
the
issue. I'll report back once I know more.
Cheers,
Sven
On Aug 10, 3:44 pm, Michael Bayer mike...@zzzcomputing.com wrote:
On Aug 10, 2010, at 9:28 AM, Sven A. Schmidt wrote:
Getting this out of the way first, because I always forget ;) :
SQLAlchemy-0.5.5, Python 2.6
I'll take a look
FKs
were in place and I never needed to specify ForeignKey(...)
Sorry for the noise,
Sven
On Aug 10, 4:10 pm, Sven A. Schmidt s...@abstracture.de wrote:
Thanks, Michael. I wish I could update to 0.6.3 but unfortunately I'll
have to stick with the deployed version of 0.5.5 for now. But in any
that there is a
mismatch between target names and specified names causing this issue. or
maybe the oracle dialect just doesn't interpret the owner part of a
foreign key constraint correctly yet (im not easily able to test things
like that with Oracle XE).
That did the trick!
Thanks a lot,
Sven
if that can always be avoided nor if that's too fragile
overall. In the end that would mean that by creating extra synonyms
for another user a working script could break. Or am I missing
something here?
Any insight greatly appreciated! :)
Cheers,
Sven
= 'AINV_OWNER' on Table(...)
Results in the error: Could not determine join condition between
parent/child tables... See 2) above.
It seems I'm stuck between a rock and a hard place here ;)
Cheers,
Sven
On Jun 23, 5:03 pm, Michael Bayer mike...@zzzcomputing.com wrote:
Sven A. Schmidt wrote:
Hi
anyone give
me advice for setting up this kind of relation on InnoDB? Thanks a
lot.
-sven-eric
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy import String, Column, Integer, ForeignKey,
ForeignKeyConstraint
from sqlalchemy.orm import relation, backref
from
properly here (the three queries at the end of the
provided code all return the same list of objects).
I would be grateful if someone could read the short piece of code
and give me advice for how to retrieve only the 'Jon Doe' object of
the base class with the query. Thanks a lot.
-sven
import
Alright, I see. I appreciate the quick reply and thanks for all the
work you putting in answering these questions.
-sven
On May 20, 4:45 pm, Michael Bayer mike...@zzzcomputing.com wrote:
sven-eric wrote:
Dear List,
I have an issue with single table inheritance and sqlalchemy
38 matches
Mail list logo