this would be a bug since we do have a list of entries that are
dependent on each other, so orderings like these need to be coded.
https://bitbucket.org/zzzeek/sqlalchemy/issues/3961/mysql-partition-options-need-to-be-after
is added which per the syntax diagram moves all the partition options
On 04/05/2017 07:42 PM, davor wrote:
It seems that
besides name_for_scalar_relationship also generate_relationship has to
be adjusted since the backref name will also not be unique.
name_for_collection_relationship is usually what you need for
bi-directional many-to-many
Are here any
It seems that besides name_for_scalar_relationship also
generate_relationship has to be adjusted since the backref name will also
not be unique.
Are here any options to make the name more unique?
On Wednesday, 6 January 2016 11:43:54 UTC+1, yoch@gmail.com wrote:
>
> For now, I don't have
I have a script.py that does roughly this:
import sqlalchemy as sa
engine = ...
part_text = """RANGE COLUMNS (my_date) (
PARTITION p20161017 VALUES LESS THAN ('2016-10-18'),
PARTITION p20161018 VALUES LESS THAN ('2016-10-19'),
PARTITION p1231 VALUES LESS THAN (MAXVALUE)
)"""
t
I use sqlalchemy to perform to insert and upsert of rows. During certain
requests for many tables I get an IntegrityError duplicate entry when using
session.merge(obj).
I tried to find an answer on the web and on the IRC but I came back
empty-handed. I'm using python 2.7, alembic 0.9.1 and
Just to expand on Mike's answer... I've run into this often on a handful of
columns.
The solution I've settled on is to set a variable:
COLUMN_SIZE_SERVERSIDE = 1
and then use that as the length on the problematic column sizes while I
work out the issues on what the length should be, and
Hi there -
the length that's in your String() type is not used by SQLAlchemy except
when it first renders DDL for CREATE TABLE, so to that extent it is safe
for the database column itself to be of a different size. This
wouldn't account for something like a client-side validation rule that
>
> Thank you very much .
Sure , I will try this
--
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
If the column names are part of the "schools_master" table, then the
easiest option is something like this:
q = session.query(AAA).limit(100)
for row in q:
for name in col_names:
print '%s = %' % (name, getattr(row, name))
Alternatively:
cols = [getattr(AAA, name) for name in
Thanks Simon ..it works
--
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 full description.
---
You
Thanks Simon for response.
Actually column names I am getting from user interface based on user
selection that is why i want pass columns in query method dynamically. can
you suggest me how can achieve this.
On Wednesday, April 5, 2017 at 5:08:50 PM UTC+5:30, Simon King wrote:
>
> On Wed,
On Wed, Apr 5, 2017 at 11:10 AM, Mayank Soni wrote:
> I am trying to pass list of columns of table into query method using
> add_columns method. Below i am mentioning code snipped.
>
> def LLL():
> Base = automap_base()
> class AAA(Base):
> __tablename__ =
Hello,
I have an application that is throwing exceptions on insert because one of
the columns was defined too short.
sqlalchemy.exc.DataError: (psycopg2.DataError) value too long for type
character varying(50)
The model is defined as:
class Device(Base):
processor = Column(String(50))
I am trying to pass list of columns of table into query method using
add_columns method. Below i am mentioning code snipped.
def LLL():
Base = automap_base()
class AAA(Base):
__tablename__ = 'schools_master'
Base.prepare(engine, reflect=True)
session =
14 matches
Mail list logo