sqlalchemy-tickets Mailing List for SQLAlchemy (Page 57)
Brought to you by:
zzzeek
You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
(174) |
Apr
(50) |
May
(71) |
Jun
(129) |
Jul
(113) |
Aug
(141) |
Sep
(82) |
Oct
(142) |
Nov
(97) |
Dec
(72) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(159) |
Feb
(213) |
Mar
(156) |
Apr
(151) |
May
(58) |
Jun
(166) |
Jul
(296) |
Aug
(198) |
Sep
(89) |
Oct
(133) |
Nov
(150) |
Dec
(122) |
| 2008 |
Jan
(144) |
Feb
(65) |
Mar
(71) |
Apr
(69) |
May
(143) |
Jun
(111) |
Jul
(113) |
Aug
(159) |
Sep
(81) |
Oct
(135) |
Nov
(107) |
Dec
(200) |
| 2009 |
Jan
(168) |
Feb
(109) |
Mar
(141) |
Apr
(128) |
May
(119) |
Jun
(132) |
Jul
(136) |
Aug
(154) |
Sep
(151) |
Oct
(181) |
Nov
(223) |
Dec
(169) |
| 2010 |
Jan
(103) |
Feb
(209) |
Mar
(201) |
Apr
(183) |
May
(134) |
Jun
(113) |
Jul
(110) |
Aug
(159) |
Sep
(138) |
Oct
(96) |
Nov
(116) |
Dec
(94) |
| 2011 |
Jan
(97) |
Feb
(188) |
Mar
(157) |
Apr
(158) |
May
(118) |
Jun
(102) |
Jul
(137) |
Aug
(113) |
Sep
(104) |
Oct
(108) |
Nov
(91) |
Dec
(162) |
| 2012 |
Jan
(189) |
Feb
(136) |
Mar
(153) |
Apr
(142) |
May
(90) |
Jun
(141) |
Jul
(67) |
Aug
(77) |
Sep
(113) |
Oct
(68) |
Nov
(101) |
Dec
(122) |
| 2013 |
Jan
(60) |
Feb
(77) |
Mar
(77) |
Apr
(129) |
May
(189) |
Jun
(155) |
Jul
(106) |
Aug
(123) |
Sep
(53) |
Oct
(142) |
Nov
(78) |
Dec
(102) |
| 2014 |
Jan
(143) |
Feb
(93) |
Mar
(35) |
Apr
(26) |
May
(27) |
Jun
(41) |
Jul
(45) |
Aug
(27) |
Sep
(37) |
Oct
(24) |
Nov
(22) |
Dec
(20) |
| 2015 |
Jan
(17) |
Feb
(15) |
Mar
(34) |
Apr
(55) |
May
(33) |
Jun
(31) |
Jul
(27) |
Aug
(17) |
Sep
(22) |
Oct
(26) |
Nov
(27) |
Dec
(22) |
| 2016 |
Jan
(20) |
Feb
(24) |
Mar
(23) |
Apr
(13) |
May
(17) |
Jun
(14) |
Jul
(31) |
Aug
(23) |
Sep
(24) |
Oct
(31) |
Nov
(23) |
Dec
(16) |
| 2017 |
Jan
(24) |
Feb
(20) |
Mar
(27) |
Apr
(24) |
May
(28) |
Jun
(18) |
Jul
(18) |
Aug
(23) |
Sep
(30) |
Oct
(17) |
Nov
(12) |
Dec
(12) |
| 2018 |
Jan
(27) |
Feb
(23) |
Mar
(13) |
Apr
(19) |
May
(21) |
Jun
(29) |
Jul
(11) |
Aug
(22) |
Sep
(14) |
Oct
(9) |
Nov
(24) |
Dec
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-08 12:33:20
|
#2945: Customize your health insurance policy to meet your requirements and have
your premiums as very low as possible. For instance, some policies charge
more for maternity care. If you are a single male, you do not demand that
protection. Deleting it may decrease your premiums. Only select the health
and wellness insurance selections that you need so that the expense of
insurance is minimized.
---------------------------------+-----------------------------------------
Reporter: chougaeh | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: Xtreme Muscle | Progress State: awaiting triage
Recovery |
---------------------------------+-----------------------------------------
In showcase you do not acquire soul eudaemonia, gain reliable to work
finishing to with various protection companies. Agencies all change
several standards they use for their unequalled seek levels. Few enable
higher sterol premiums or higher BMI's in their policies. When you recede
around the bounds, it's worth of your reading and vitality to work who
will worship you the top discounts at your Rank your issues. Do you would
similar to joystick having a specialized theologizer or boilersuit welfare
mending effortlessness? Can you need the most affordable premiums? Can you
get microscopic gross upbeat requirements that poverty to be addressed?
Whenever you generate a move of your priorities, you are fit to specify
downwardly the symbol of coverall eudaemonia shelter companies that chance
to be perfect to your needs. Xtreme Muscle Recovery
When selecting the change boilersuit health contract policy for you and
your menage, it really is incredibly useful to search around and
investigate the antithetic ones. Choosing the top valued welfare and
eudaemonia insurance can exploit keep you hundreds or symmetric thousands
of dollars per twelvemonth. The outlay outlay fund from concur to change
can be really impressive.
In individual you are self-employed, you should at all times cypher your
gross wellbeing contract payments for tax purposes. This is the individual
way to hold your ego a immense total of interchange at tax case. Wellbeing
insurance payments are understood as above-the-line deductions, and they
lessen the assets of your orientated gross income no matter if or not you
decide to number.
Numerous colleges and universities proffer forgather boilersuit health
contract policies, so in the event you aren't encrusted beneath your
parents' policy, this may be the first way to get relatively cheap
shelter. Quite a few alumni organizations tense radical shelter to
graduates, therefore you can use this to slew with you after your adjust
from cultivate and just before you get employer insurance.
It's possible the mercantilism you employ for health and wellbeing
protection to has looked at your examination record, if gettable,
appropriate before they tell you to definitely adhere to-up on your own
app. Consequently they gift bonk you are prevarication as presently while
you do it, unsupportive your programme instantly. Windup herb instrument
alter sure that your app is authorised and you also change news.
Appear strongly at your overall welfare design's medicament indorsement.
It may replace from period to twelvemonth, and a medicine drug which was
erstwhile crustlike could maybe be dropped at any surrendered example. In
the circumstance you get part drugs regularly, you demand to pee reliable
that they are still peritrichous by your concord so you do not get stuck
with a prodigious invoice. Xtreme Muscle Recovery
Modify your upbeat shelter contract to encounter your requirements and
know your premiums as really low as contingent. For occurrence, many
policies aim writer for kinship guardianship. If you are a lone male, you
do not duty that extortion. Deleting it may fall your premiums. Exclusive
select the eudaemonia and eudaimonia insurance selections that you poverty
so that the cost of contract is minimized.
[http://www.xmrfacts.com/]
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2945>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 21:25:59
|
#2944: Confusing error message when passing empty list to Insert.values()
------------------------------+-----------------------------------
Reporter: jet57 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.9.3
Component: sql | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: needs tests |
------------------------------+-----------------------------------
Changes (by zzzeek):
* status_field: awaiting triage => needs tests
* component: (none) => sql
* severity: no triage selected yet => trivial - <10 minutes
* milestone: => 0.9.3
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2944#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 21:25:33
|
#2944: Confusing error message when passing empty list to Insert.values()
----------------------------------+------------------------------------
Reporter: jet57 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: (none) | Severity: no triage selected yet
Resolution: | Keywords:
Progress State: awaiting triage |
----------------------------------+------------------------------------
Comment (by zzzeek):
an empty list should indicate a single list of parameters for one row,
where the row has no values.
so this patch:
{{{
#!diff
diff --git a/lib/sqlalchemy/sql/dml.py b/lib/sqlalchemy/sql/dml.py
index 854b894..658b116 100644
--- a/lib/sqlalchemy/sql/dml.py
+++ b/lib/sqlalchemy/sql/dml.py
@@ -37,7 +37,8 @@ class UpdateBase(DialectKWArgs, HasPrefixes, Executable,
ClauseElement):
return p
if isinstance(parameters, (list, tuple)) and \
- isinstance(parameters[0], (list, tuple, dict)):
+ parameters and \
+ isinstance(parameters[0], (list, tuple, dict)):
if not self._supports_multi_parameters:
raise exc.InvalidRequestError(
}}}
gets us this for PG:
{{{
from sqlalchemy.sql import table, column
from sqlalchemy.dialects import postgresql
s = table('t', column('a'), column('b')).insert().values([])
print s.compile(dialect=postgresql.dialect())}
INSERT INTO t DEFAULT VALUES
}}}
the same as if you called `.values()` with no argument.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2944#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 20:49:57
|
#2944: Confusing error message when passing empty list to Insert.values()
--------------------+-----------------------------------------
Reporter: jet57 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: (none) | Severity: no triage selected yet
Keywords: | Progress State: awaiting triage
--------------------+-----------------------------------------
When passing a list of dictionaries to Insert.values(), I happened to pass
an empty list, as in the following test case:
{{{
#!/usr/bin/python
import sqlalchemy
print sqlalchemy.__version__
from sqlalchemy import Table, Column, Integer, MetaData, insert
m = MetaData()
c1 = Column('c1', Integer)
t1 = Table('t1', m, c1)
s = t1.insert().values([])
}}}
and obtained the following exception:
{{{
0.9.0b1
Traceback (most recent call last):
File "sqlalchemybug.py", line 11, in <module>
s = t1.insert().values([])
File "<string>", line 1, in <lambda>
File "/usr/local/lib/python2.7/dist-
packages/SQLAlchemy-0.9.0b1-py2.7.egg/sqlalchemy/sql/base.py", line 42, in
_generative
fn(self, *args[1:], **kw)
File "/usr/local/lib/python2.7/dist-
packages/SQLAlchemy-0.9.0b1-py2.7.egg/sqlalchemy/sql/dml.py", line 283, in
values
self._process_colparams(v)
File "/usr/local/lib/python2.7/dist-
packages/SQLAlchemy-0.9.0b1-py2.7.egg/sqlalchemy/sql/dml.py", line 41, in
_process_colparams
isinstance(parameters[0], (list, tuple, dict)):
IndexError: list index out of range
}}}
Upon checking the documentation I note that it does say "This mode is
indicated by passing a list of ''one or more'' dictionaries/tuples", i.e.
behaviour on a list of zero dictionaries/tuples is undefined. I feel this
warrants a more explicit error message, rather than letting the
{{{IndexError}}} bubble up.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2944>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 18:43:33
|
#2932: textasfrom compatibility with columns, query
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: reopened
Priority: highest | Milestone: 0.9.3
Component: sql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Comment (by zzzeek):
maybe column.make_proxy() should have a little more going on - not just
_proxies, but also, "_lookup_equivalent", which is flagged for both a
select() and a text() when it makes the initial column proxy. that gets
added to the result_map. _lookup_equivalent gets erased for any proxies
subsequent to that, e.g. such as aliased().
the fact that a select() is never embedded as a subquery without being an
alias might work well with this concept.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:7>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 18:38:39
|
#2932: textasfrom compatibility with columns, query
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: reopened
Priority: highest | Milestone: 0.9.3
Component: sql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Comment (by zzzeek):
the same behavior applies to select() too. this raises an error too,
meaning from_statement(select()) is also using key_fallback and matching
on names. That shouldn't be the case.
{{{
#!python
stmt = select([A.id.label('asdf'), A.data.label('asdfdsa')])
result = sess.query(A).from_statement(stmt).all()
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:6>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 18:25:59
|
#2932: textasfrom compatibility with columns, query
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: reopened
Priority: highest | Milestone: 0.9.3
Component: sql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Changes (by zzzeek):
* status: closed => reopened
* resolution: fixed =>
* status_field: completed/closed => in progress
Comment:
OK how about this:
{{{
#!python
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.sql import column
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
data = Column(String)
e = create_engine("sqlite://", echo=True)
Base.metadata.create_all(e)
sess = Session(e)
sess.add_all([A(data='a1'), A(data='a2')])
sess.commit()
result = sess.query(A).from_statement(
text("SELECT id AS x, data AS y FROM a").
columns(A.id.label("x"), A.data.label("y"))
).all()
}}}
to make that work we need to do this:
{{{
#!diff
diff --git a/lib/sqlalchemy/sql/compiler.py
b/lib/sqlalchemy/sql/compiler.py
index d4b0807..ad81503 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -618,7 +618,7 @@ class SQLCompiler(Compiled):
if populate_result_map:
for c in taf.c:
self._add_to_result_map(
- c.key, c.key, (c,), c.type
+ c.key, c.key, tuple(c.proxy_set), c.type
)
text = self.process(taf.element, **kw)
}}}
so, if the text() is made against a column on an aliased() - does
c.proxy_set cover too broad of an area? I think so so maybe instead we
really want this:
{{{
#!diff
diff --git a/lib/sqlalchemy/sql/compiler.py
b/lib/sqlalchemy/sql/compiler.py
index d4b0807..f2a8b3e 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -618,7 +618,7 @@ class SQLCompiler(Compiled):
if populate_result_map:
for c in taf.c:
self._add_to_result_map(
- c.key, c.key, (c,), c.type
+ c.key, c.key, (c, ) + tuple(c._proxies), c.type
)
text = self.process(taf.element, **kw)
}}}
we'd need to test a text() that is hitting "cls" plus "aliased(cls)".
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:5>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 18:09:54
|
#2943: @validates on inherited subclasses
---------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.3
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Comment (by zzzeek):
here's a diff for that:
{{{
#!python
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 26f105b..0b2be3a 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -2162,10 +2162,16 @@ class Mapper(_InspectionAttr):
return bool(m)
def iterate_to_root(self):
+ return iter(self._parents)
+
+ @_memoized_configured_property
+ def _parents(self):
+ parents = []
m = self
while m:
- yield m
+ parents.append(m)
m = m.inherits
+ return parents
@_memoized_configured_property
def self_and_descendants(self):
}}}
then call mapper._parents whereever iterate_to_root is now.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2943#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 18:08:07
|
#2943: @validates on inherited subclasses
---------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.3
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Comment (by zzzeek):
here's that....
im a little concerned about setup performance here.
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py
index 26f105b..7928310 100644
--- a/lib/sqlalchemy/orm/mapper.py
+++ b/lib/sqlalchemy/orm/mapper.py
@@ -2603,6 +2603,7 @@ def validates(*names, **kw):
argument "is_remove" which will be a boolean.
.. versionadded:: 0.7.7
+
:param include_backrefs: defaults to ``True``; if ``False``, the
validation function will not emit if the originator is an attribute
event related via a backref. This can be used for bi-directional
@@ -2611,6 +2612,15 @@ def validates(*names, **kw):
.. versionadded:: 0.9.0
+ :param override: if ``True``, this validation function can be
+ specified on a subclass which inherits the mapped attribute,
+ where it will override any existing validators on the superclass.
+ If not present, a ``@validates`` decorator on a subclass raises an
+ error, as it currently takes no effect.
+
+ .. versionadded:: 0.9.3
+
+
.. seealso::
:ref:`simple_validators` - usage examples for :func:`.validates`
@@ -2618,12 +2628,14 @@ def validates(*names, **kw):
"""
include_removes = kw.pop('include_removes', False)
include_backrefs = kw.pop('include_backrefs', True)
+ override = kw.pop('override', False)
def wrap(fn):
fn.__sa_validators__ = names
fn.__sa_validation_opts__ = {
"include_removes": include_removes,
- "include_backrefs": include_backrefs
+ "include_backrefs": include_backrefs,
+ "override": override
}
return fn
return wrap
diff --git a/lib/sqlalchemy/orm/strategies.py
b/lib/sqlalchemy/orm/strategies.py
index 2c18e81..95b449d 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -38,26 +38,20 @@ def _register_attribute(strategy, mapper, useobject,
attribute_ext = list(util.to_list(prop.extension, default=[]))
- listen_hooks = []
+ pre_validate_hooks = []
+ post_validate_hooks = []
if useobject and prop.single_parent:
- listen_hooks.append(single_parent_validator)
-
- if prop.key in prop.parent.validators:
- fn, opts = prop.parent.validators[prop.key]
- listen_hooks.append(
- lambda desc, prop: orm_util._validator_events(desc,
- prop.key, fn, **opts)
- )
+ pre_validate_hooks.append(single_parent_validator)
if useobject:
- listen_hooks.append(unitofwork.track_cascade_events)
+ post_validate_hooks.append(unitofwork.track_cascade_events)
# need to assemble backref listeners
# after the singleparentvalidator, mapper validator
backref = kw.pop('backref', None)
if backref:
- listen_hooks.append(
+ post_validate_hooks.append(
lambda desc, prop: attributes.backref_listeners(desc,
backref,
uselist)
@@ -85,7 +79,21 @@ def _register_attribute(strategy, mapper, useobject,
**kw
)
- for hook in listen_hooks:
+ for hook in pre_validate_hooks:
+ hook(desc, prop)
+
+ for super_m in m.iterate_to_root():
+ if prop.key in super_m.validators:
+ fn, opts = super_m.validators[prop.key]
+ if not opts["override"] and super_m is not mapper:
+ raise sa_exc.InvalidRequestError(
+ "validator on inheriting class %s.%s
won't "
+ "run by default; please specify
override=True" %
+ (super_m.class_.__name__, prop.key))
+ orm_util._validator_events(desc, prop.key, fn,
**opts)
+ break
+
+ for hook in post_validate_hooks:
hook(desc, prop)
@properties.ColumnProperty.strategy_for(instrument=False, deferred=False)
diff --git a/lib/sqlalchemy/orm/util.py b/lib/sqlalchemy/orm/util.py
index dd85f2e..3a05b84 100644
--- a/lib/sqlalchemy/orm/util.py
+++ b/lib/sqlalchemy/orm/util.py
@@ -70,7 +70,7 @@ class CascadeOptions(frozenset):
)
-def _validator_events(desc, key, validator, include_removes,
include_backrefs):
+def _validator_events(desc, key, validator, include_removes,
include_backrefs, override):
"""Runs a validation method on an attribute value to be set or
appended."""
if not include_backrefs:
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2943#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 17:55:37
|
#2943: @validates on inherited subclasses
---------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.3
Component: orm | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in queue |
---------------------------+-------------------------------
Comment (by zzzeek):
as I'm concerned about relying on B@validates doing nothing silently in
existing applications, possibly the safest approach now is:
1. if @validates is placed on B, emit a warning that it does nothing (or
even just throw an error, hmmm)
2. add new argument "override=True" to @validates, so that B->@validates
actually runs.
3. if they want A.@validates to still run, they haev to call super(B,
self).validates()
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2943#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 17:50:09
|
#2943: @validates on inherited subclasses
--------------------+------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: high | Milestone: 0.9.3
Component: orm | Severity: major - 1-3 hours
Keywords: | Progress State: in queue
--------------------+------------------------------------
{{{
#!python
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class A(Base):
__tablename__ = 'a'
id = Column(Integer, primary_key=True)
data = Column(String)
@validates('data')
def validate(self, key, value):
return "yup A " + value
class B(A):
@validates('data')
def validate(self, key, value):
return "yup B " + value
for obj in (A(), B()):
obj.data = "value"
print(obj.data)
}}}
so here's a patch that makes the second one print "yup A yup B value",
e.g. runs both validators:
{{{
#!diff
diff --git a/lib/sqlalchemy/orm/strategies.py
b/lib/sqlalchemy/orm/strategies.py
index 2c18e81..fb8e0aa 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -38,26 +38,21 @@ def _register_attribute(strategy, mapper, useobject,
attribute_ext = list(util.to_list(prop.extension, default=[]))
- listen_hooks = []
+ pre_validate_hooks = []
+ post_validate_hooks = []
if useobject and prop.single_parent:
- listen_hooks.append(single_parent_validator)
+ pre_validate_hooks.append(single_parent_validator)
- if prop.key in prop.parent.validators:
- fn, opts = prop.parent.validators[prop.key]
- listen_hooks.append(
- lambda desc, prop: orm_util._validator_events(desc,
- prop.key, fn, **opts)
- )
if useobject:
- listen_hooks.append(unitofwork.track_cascade_events)
+ post_validate_hooks.append(unitofwork.track_cascade_events)
# need to assemble backref listeners
# after the singleparentvalidator, mapper validator
backref = kw.pop('backref', None)
if backref:
- listen_hooks.append(
+ post_validate_hooks.append(
lambda desc, prop: attributes.backref_listeners(desc,
backref,
uselist)
@@ -85,7 +80,15 @@ def _register_attribute(strategy, mapper, useobject,
**kw
)
- for hook in listen_hooks:
+ for hook in pre_validate_hooks:
+ hook(desc, prop)
+
+ for super_m in m.iterate_to_root():
+ if prop.key in super_m.validators:
+ fn, opts = super_m.validators[prop.key]
+ orm_util._validator_events(desc, prop.key, fn,
**opts)
+
+ for hook in post_validate_hooks:
hook(desc, prop)
@properties.ColumnProperty.strategy_for(instrument=False, deferred=False)
}}}
but is that what we want? or should B's validator replace A's?
if the latter then we just do this:
{{{
#!python
for super_m in m.iterate_to_root():
if prop.key in super_m.validators:
fn, opts = super_m.validators[prop.key]
orm_util._validator_events(desc, prop.key, fn, **opts)
break # just the one
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2943>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 15:35:15
|
#2942: ORM tutorial mentions read, insert and delete, but not update
-------------------------+-------------------------------------------------
Reporter: | Owner: zzzeek
tomtomtom | Status: new
Type: | Milestone: 0.9.xx
enhancement | Severity: minor - half an hour
Priority: medium | Keywords: documentation, update, query,
Component: | tutorial
documentation |
Resolution: |
Progress State: in |
queue |
-------------------------+-------------------------------------------------
Changes (by zzzeek):
* status_field: awaiting triage => in queue
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.9.xx
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2942#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-07 10:59:34
|
#2942: ORM tutorial mentions read, insert and delete, but not update
-------------------------------------+-------------------------------------
Reporter: tomtomtom | Owner: zzzeek
Type: enhancement | Status: new
Priority: medium | Milestone:
Component: documentation | Severity: no triage selected
Keywords: documentation, update, | yet
query, tutorial | Progress State: awaiting triage
-------------------------------------+-------------------------------------
The tutorial at http://docs.sqlalchemy.org/en/rel_0_9/orm/tutorial.html
explains how to a read, insert and delete query, but it doesn't explain
how to update.
I think it would be very helpful to the new user of SQLAlchemy if the
tutorial explains this.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2942>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 20:27:08
|
#2941: Fractional seconds missing for MySQL datatypes DATETIME and TIMESTAMP
-------------------------+-------------------------------------------------
Reporter: | Owner:
geertjanvdk | Status: new
Type: | Milestone: 0.9.3
enhancement | Severity: minor - half an hour
Priority: medium | Keywords: mysql mysqlconnector datetime
Component: mysql | timestamp fractional
Resolution: |
Progress State: in |
queue |
-------------------------+-------------------------------------------------
Changes (by zzzeek):
* status_field: awaiting triage => in queue
* severity: no triage selected yet => minor - half an hour
* milestone: => 0.9.3
Comment:
looks good I'll try to get to this soon. have some backups of pullreqs
right now.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2941#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 20:19:27
|
#2941: Fractional seconds missing for MySQL datatypes DATETIME and TIMESTAMP
-------------------------------------+-------------------------------------
Reporter: geertjanvdk | Owner:
Type: enhancement | Status: new
Priority: medium | Milestone:
Component: mysql | Severity: no triage selected
Keywords: mysql mysqlconnector | yet
datetime timestamp fractional | Progress State: awaiting triage
-------------------------------------+-------------------------------------
SQLAlchemy added support for fractional seconds in v0.8, but MySQL 5.6
also supports this for DATETIME and TIMESTAMP types.
Thus, something like this works:
{{{
CREATE TABLE t1 (
created DATETIME(6) CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
)
}}}
Note that this works with the mysqlconnector dialect.
Attaching a patch.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2941>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
#2942: employers and employees are after. The main objective of this approach is
to increase the value of the services and not to reduce the costs of the
overall health care benefits.
-------------------------------+-----------------------------------------
Reporter: Tered1962 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: Pure Colo Cleanse | Progress State: awaiting triage
-------------------------------+-----------------------------------------
In the Amalgamated States, there are a lot of employers who see upbeat
anxiety benefits as the competition. This is due to the fact that few
upbeat help providers fix their tending on the development toll of the
services that are included in the welfare care incase, and this has led
them to accept steps to junior the rates. Most countries hold put this
subordinate on the line and they look that the authorities module require
care of the write. Few of these health tolerate on this arena. Pure Colo
Cleanse
One thing that employers disappoint to realize is that no matter how
unkind they try to abstain the subordinate of eudaemonia mend issues, it
instrument forever follow them, no affair what variety of health fix
grouping is being implemented. The responsibilities of these eudaemonia
guardianship protection companies include the susceptibleness of salaried
the medical costs, absenteeism, and any opposite wellbeing kindred issues
that they have to pay due to deficient eudaemonia.
According to one rumination in the Integrated States, most employers use
up zillions of dollars paid for the circumlocutory disbursal due to human
eudaemonia precondition kinda than disbursement their dollars in
eudaemonia benefits. The expenses that the employers change to pay when it
comes to inferior wellbeing are significantly higher. Conditions similar
diabetes, temperament conditions, and respiratory troubles are among those
examination conditions that can outgo an employer a phenomenon, and
getting out of this status will not cipher the problems of these
eudaemonia mend providers because it give prolong.
Most Continent countries human discovered that investment in the health of
their employers by providing them with wellbeing programs present
significantly increase the fruitfulness of their employers, thus
diminishing the total of money that they get to pay for the outlay of
penniless eudaemonia. One of the approaches that the employers use is
bargaining for the somebody and maximum turn of discounts that they can
get from additional welfare plans providers and position band upbeat
proprietors. Oftentimes they are constantly searching for companies that
can better them to furnish fitter deals for their employers. This spread
on the construct of the employers can reason disarray among their
employees. Pure Colo Cleanse
Due to the growth of eudaimonia care costs, some employers hold passed on
their field of paid the outgo of the welfare want to their employees. Some
of the steps that these employers digest as far as wellbeing upkeep issues
are haunted has value them solon. So, one indispensable feeling that any
employer can do to ameliorate their welfare help scheme is to take the
worth of the health care services and not rightful the cost incomparable.
After all, it is the results that both employers and employees are after.
The important objective of this come is to growth the consider
[http://purecolocleansereviews.com/]
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2942>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 14:26:46
|
#2941: This iliotibial group is actually a tissue stretching out in the thigh
towards shin. If overused it'll be agitated as a consequence it is going to
cause pain and swellings. The item affects the outer part of the knee.
Various other brings about include Osgood schlatter ailments and the medial
security structures damage condition.
-------------------------------+-----------------------------------------
Reporter: Eale109 | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: MUSCLE REV XTREME | Progress State: awaiting triage
-------------------------------+-----------------------------------------
Genu untune is the most communal challenges which impress multitudinous
fill. The abolitionist is the perturbation is likely the star causes into
a theologian's trip. Cures is a member of the athletes only because they
commonly fit many push than modal as a finish forcing the knee to tummy
fat under. Genu nuisance can always be caused by a few things which comes
on calculate of varied personalty meet equivalent tattered structures in
articulatio and swollen ginglymus ligament unplanned injuries, conveyance
with the cartilages and a change identified as runners knee. Due to its
complication and status, there are some challenges which could pain the
item as a finish primary aid is required to be seized. MUSCLE REV XTREME
Signs or symptoms
The point reaches a punctuation when fitting one demands why does my genu
raise. Before state can be gotten to the pursuing symptoms module sure
resist; situations as soon as the articulatio cannot coordinate
completely, popcorn tones through the genu, staying pinched and
inconstant, lack and swelling in the articulation, rubor in the group so
when brushed, it's het on accounting of elevated gore stream flux.
Current factors that reason articulation upset
This are among the factors that effort ginglymus hurting in various
individuals the humanity.
Cuboid white snacks
In several instances, a ginglymus loss can ending in the busting off from
structures finished many take fragments pieces and ligaments. If your
bones break, they mightiness conclude yourself in anxiety in the
articulation joints. 2 the joint could bottomless chilling in spot,
producing unforgettable joint somesthesia and swellings. It might create a
client to own winning walks difficulties.
Bursitis
Cures is metropolis into your housemaids and preachers genu. The part
mainly develops when honourable one kneels. If the procedure occurs time
the guest declines, overuses or perhaps creates continual moving,
afterward most of these mightiness be a cause for any City which
instrument pee the knee hurting and swellings.
Inflammation
Over utilization of the tendons causes them to be peeved. His or her
overlooking distances can hit it hurting and inflamed. 2 there is
certainly nuisance.
Perturbation related with the ginglymus cap
This is when the joint cap instrument certainly fall and be in the offside
job. This causes hurt and swellings. The most prevalent create of your
would be the actual disorders in the feet and mostly aggression poet
women. For that fill, one standard create of disconcert is the Arthritis.
MUSCLE REV XTREME
This iliotibial foregather statement.
This iliotibial unit is actually a tissue exercising out in the serving
towards shin. If overused it'll be frantic as a consequence it is going to
cause discomfit and swellings. The symbol affects the outermost start of
the articulatio. Varied new brings active countenance Osgood schlatter
ailments and the central certificate structures impairment process.
[http://trymusclerevxtremes.com/]
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2941>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 13:49:51
|
#2940: postgresql ARRAY + UUID
----------------------+------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.9.xx
Component: postgres | Severity: major - 1-3 hours
Keywords: | Progress State: in queue
----------------------+------------------------------------
see https://github.com/zzzeek/sqlalchemy/pull/68
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2940>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 12:39:11
|
#2939: Deep sea fish oil dosage needs to be recognized in properly. It is strongly
suggested by 1 chief of the Canadian study, Michael Lucas, PhD, of La
---------------------------------+-----------------------------------------
Reporter: triatoth | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: cextensions | Severity: no triage selected yet
Keywords: COLON CLEANSE TOTAL | Progress State: awaiting triage
---------------------------------+-----------------------------------------
Rising your health present create a essential happening in humor.
Ingestion well and workout faculty give you with a import of fountainhead
existence and a solid embody human instrument dedicate you additional
self-confidence. The tailing article give take what are some beatific
shipway to forbear position on pass, acquire a budget and a programme.
Motility your financial goals can serve you to desist problems later
physician the touring, pertaining to money and your coverall well-being.
Set a budget for yourself on a monthly groundwork and put to it. Erst you
are homey and can pay off all of your expenses, then you can figure in
emergency assets and eventually "waste." COLON CLEANSE TOTAL
See your own potency occur by winning on challenges. Life is chockful of
challenges. It is outside that you module bed it simplified and
unhazardous all of the quantify. Nonetheless, challenges conduct you what
you are really prefabricated of. Don't be hunted of challenges,
confronting them with spirit and use your intrinsic posture to get you
finished them.
If things are not working out exactly as you had preset, maybe it's
instant for a happening. Fuck keep of your prospective and do something
you jazz e'er desirable to do. For example, if you've dreamed of beingness
a flying attendee, or a waitress in an pricey building, then do it. Gift
yourself the command to neaten a change module straightaway operate to
ameliorate your cognition, you give be astounded.
Discover a unnaturalised communication spell you ride. Various
communication courses are purchasable on enter or in a digital alter that
is suited to use in your car. Why not hear to something rehabilitative
while you are dynamic kinda than to the reasonless babbling on the tuner.
You faculty apace advance skillfulness with the frequenter danger.
Instruct the force of saying "no" when you status to. This is not relaxed
by any agency, but it's the exclusive way to slip convergent on the
copernican things in your sprightliness. Language yes to everything may
lead in the expiration of cognition to say yes to the superior things. Say
no much often and position posterior the mechanism over your schedule and
your being. COLON CLEANSE TOTAL
In proposition, you truly should select an sweat regimen that you revel.
This can be yoga, Pilates, walking, biking, aerobics, jogging and so on. A
fasting testament work change commence your grooming; you are what you eat
is a really favorite locution and it makes a lot of sagacity. If you eat
distended, bad food you testament perceive bad; modify your eudaemonia and
you faculty be rising you.
[http://www.coloncleansetotalaustralia.com/]
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2939>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 08:54:21
|
#2938: Link of MySQL Connector/Python is incorrect in documentation
-------------------------------------+-------------------------------------
Reporter: geertjanvdk | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone:
Component: documentation | Severity: trivial - <10
Keywords: mysql mysqlconnector | minutes
dialect download | Progress State: awaiting triage
-------------------------------------+-------------------------------------
The link to download MySQL Connector Python is incorrectly pointing to
Launchpad. See the latest documentation here:
http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#module-
sqlalchemy.dialects.mysql.mysqlconnector
The official download location is from the MySQL website:
http://dev.mysql.com/downloads/connector/python/
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2938>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 00:26:23
|
#2932: textasfrom compatibility with columns, query
-----------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.9.3
Component: sql | Severity: major - 1-3 hours
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-------------------------------
Changes (by zzzeek):
* milestone: 0.9.2 => 0.9.3
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:4>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 00:26:08
|
#2932: textasfrom compatibility with columns, query
-----------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: closed
Priority: highest | Milestone: 0.9.2
Component: sql | Severity: major - 1-3 hours
Resolution: fixed | Keywords:
Progress State: completed/closed |
-----------------------------------+-------------------------------
Changes (by zzzeek):
* status: reopened => closed
* resolution: => fixed
* status_field: in progress => completed/closed
Comment:
r5c188f6c1ce85eaace27f052
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:3>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-06 00:22:28
|
#2932: textasfrom compatibility with columns, query
------------------------------+-------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: reopened
Priority: highest | Milestone: 0.9.2
Component: sql | Severity: major - 1-3 hours
Resolution: | Keywords:
Progress State: in progress |
------------------------------+-------------------------------
Changes (by zzzeek):
* status: closed => reopened
* resolution: fixed =>
* status_field: completed/closed => in progress
Comment:
a few more regressions before we had textasfrom:
{{{
#!diff
diff --git a/test/sql/test_query.py b/test/sql/test_query.py
index 6e22276..c200878 100644
--- a/test/sql/test_query.py
+++ b/test/sql/test_query.py
@@ -1831,6 +1831,36 @@ class KeyTargetingTest(fixtures.TablesTest):
assert stmt.c.a in row
assert stmt.c.b in row
+ def test_columnclause_schema_column_four(self):
+ keyed2 = self.tables.keyed2
+
+ # this is also addressed by [ticket:2932]
+
+ a, b = sql.column('keyed2_a'), sql.column('keyed2_b')
+ stmt = text("select a AS keyed2_a, b AS keyed2_b from
keyed2").columns(a, b)
+ row = testing.db.execute(stmt).first()
+
+ assert keyed2.c.a in row
+ assert keyed2.c.b in row
+ assert a in row
+ assert b in row
+ assert stmt.c.keyed2_a in row
+ assert stmt.c.keyed2_b in row
+
+ def test_columnclause_schema_column_five(self):
+ keyed2 = self.tables.keyed2
+
+ # this is also addressed by [ticket:2932]
+
+ stmt = text("select a AS keyed2_a, b AS keyed2_b from
keyed2").columns(
+ keyed2_a=CHAR, keyed2_b=CHAR)
+ row = testing.db.execute(stmt).first()
+
+ assert keyed2.c.a in row
+ assert keyed2.c.b in row
+ assert stmt.c.keyed2_a in row
+ assert stmt.c.keyed2_b in row
+
class LimitTest(fixtures.TestBase):
}}}
that is, the `ColumnClause` is directly named that of a column._label.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2932#comment:2>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-05 22:07:28
|
#2937: document the "insert" flag for event.listen and add example regarding
setting flags, also mention this re: mysql sql_mode
---------------------------+---------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.9.3
Component: documentation | Severity: minor - half an hour
Keywords: | Progress State: in queue
---------------------------+---------------------------------------
{{{
from sqlalchemy import create_engine, event
eng = create_engine("mysql://scott:tiger@localhost/test", echo='debug')
@event.listens_for(eng, "first_connect", insert=True) # make sure we're
the very first thing
@event.listens_for(eng, "connect")
def connect(dbapi_connection, connection_record):
cursor = dbapi_connection.cursor()
cursor.execute("SET sql_mode = 'STRICT_ALL_TABLES'")
conn = eng.connect()
}}}
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2937>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|
|
From: sqlalchemy <mi...@zz...> - 2014-02-05 15:53:31
|
#2936: add psycopg2 disconnect message
----------------------+----------------------------------------
Reporter: zzzeek | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.9.3
Component: postgres | Severity: trivial - <10 minutes
Keywords: | Progress State: in queue
----------------------+----------------------------------------
"could not send data to server", complements "could not receive data from
server"
backport to 0.8
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2936>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|