On Jul 6, 2008, at 1:16 AM, Empty wrote:
You might want to look into the new instrument_declarative function in
0.5. It allows you to wrap a class with the declarative functionality
without using the metaclass. This should permit you to work with a
subclass, although I haven't tried it.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
hi ilya, everybody,
that time, i was using elixir and not the select() function in sa.
elixir.query.filter() returned a list of objects, with their fields as
attributes (same as the entity definition in elixir).
thus, to have each record
On Jul 4, 3:41 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 4, 2008, at 5:40 AM, Iwan wrote:
Assume also that CC.get_context_hash() returns id(CC.get_context())
Session = scoped_session(sessionmaker(),
scopefunc=CC.get_context_hash)
if get_context_hash returns a dict, thats
On Jul 6, 2008, at 5:08 AM, Iwan wrote:
On Jul 4, 3:41 pm, Michael Bayer [EMAIL PROTECTED] wrote:
On Jul 4, 2008, at 5:40 AM, Iwan wrote:
Assume also that CC.get_context_hash() returns id(CC.get_context())
Session = scoped_session(sessionmaker(),
scopefunc=CC.get_context_hash)
if
i have some tree-walking query via many2many, having configurable levels of
hops to look into.
and it returns very different results for len(query) and query.count(): len()
stays constant above the depth of the tree (correct), while .count() keeps
growing an growing.
what's can be wrong?
On Jul 6, 2008, at 11:33 AM, [EMAIL PROTECTED] wrote:
i have some tree-walking query via many2many, having configurable
levels of
hops to look into.
and it returns very different results for len(query) and
query.count(): len()
stays constant above the depth of the tree (correct),
the query is ugly;
seems count(1) counts the decart-product or something:
SA: INFO SELECT count(1) AS count_1
FROM Otnoshenie, mm_nazn2rabmesto, mm_nazn2pozicia, mm_pozicia2otdel,
mm_otdel2otdel AS mm_otdel2otdel, mm_otdel2otdel AS mm_otdel2otdel1,
mm_otdel2otdel AS mm_otdel2otdel2,
it also accepts cls as a keyword argument which is used as the base
class:
Base = declarative_base(..., cls=MyMixin)
you can also add a mixin to any class in Python like:
Base = declarative_base(...)
MyBase = type(MyBase, (Base, MyMixin), {})
Thanks! Both are
On Jul 6, 2008, at 12:21 PM, [EMAIL PROTECTED] wrote:
the query is ugly;
seems count(1) counts the decart-product or something:
SA: INFO SELECT count(1) AS count_1
FROM Otnoshenie, mm_nazn2rabmesto, mm_nazn2pozicia,
mm_pozicia2otdel,
mm_otdel2otdel AS mm_otdel2otdel, mm_otdel2otdel AS
On Sunday 06 July 2008 21:33:49 Michael Bayer wrote:
On Jul 6, 2008, at 12:21 PM, [EMAIL PROTECTED] wrote:
the query is ugly;
seems count(1) counts the decart-product or something:
SA: INFO SELECT count(1) AS count_1
FROM Otnoshenie, mm_nazn2rabmesto, mm_nazn2pozicia,
Is possible create the fields with nullable=False by default?
It's heavy to have to add this to each field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post to this group, send email to
And, why can I add 'default'
--
def Column0(*a, **k):
return Column(nullable=False, default='', *a, **k)
--
it shows the next error:
TypeError: _FigureVisitName object got multiple values for keyword
argument 'default'
On Jul 6, 7:53 pm, [EMAIL PROTECTED] wrote:
u can
I'm using so:
def Column0(*a, **k):
return Column(nullable=False, default='', *a, **k)
groups_table = Table('foo', metadata,
Column0('id', Integer, primary_key=True),
Column0('bar', Unicode(16)),
)
Note: I'm using SA 0.5 beta.
But well, that solved it. Thank you
I think that there is a bug.
autoincrement doesn't works with *default=''*
Any solution to this problem?
On Jul 6, 10:46 pm, Kless [EMAIL PROTECTED] wrote:
I'm using so:
def Column0(*a, **k):
return Column(nullable=False, default='', *a, **k)
groups_table = Table('foo',
Does anybody could say anything more?
Defaults to False: used internally to indicate that this column is
used as the quasi-hidden oid column
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To post
the underscore here means, doesn't do what you'd want it to.
explicit oid support is likely to be removed soon.
On Jul 6, 2008, at 7:35 PM, Kless wrote:
Does anybody could say anything more?
Defaults to False: used internally to indicate that this column is
used as the quasi-hidden oid
On Jul 6, 2008, at 7:06 PM, Kless wrote:
I think that there is a bug.
autoincrement doesn't works with *default=''*
Any solution to this problem?
the docs for autoincrement need to be read closely. This flag only
applies to Integer columns with the primary key flag set. I'm not
Spoke a bit to soon... looks like that cls argument is only available
in 0.5, and the type() mixin trick still complains about not having a
mapped_table specifed. SQLA 0.4.6 is unhappy with the snippet
below...
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declarative_base
18 matches
Mail list logo