All,
I am a newbie to SQLAlchemy.
I needed an ORM for my system and after a research, I decided on
SQLAlchemy.

I used SQLAutocode that generated this model.py (a snippet is pasted
here)....
-------------------------------------
X----------------------------------------------------------
Sources =  Table('Sources', metadata,
    Column(u'id', PGInteger(), primary_key=True, nullable=False,
default=PassiveDefault(u'nextval(\'"public"."Sources_id_seq"\'::regclass)')),
            Column(u'name', PGString(length=256,
convert_unicode=False, assert_unicode=None), primary_key=False,
nullable=False),
            Column(u'description', PGString(length=256,
convert_unicode=False, assert_unicode=None), primary_key=False,
nullable=False),

    schema='public'
    )
class SourcesObject(object): pass
mapper(SourcesObject, Sources)
-------------------------------------
X----------------------------------------------------------

When I try to insert data into this table using this piece of code,

source = SourcesObject()
source.name = "a2"
source.description = "b2"
session.save(source)
session.commit()

I get this error,
******************************************************************************************
raise exceptions.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
sqlalchemy.exceptions.ProgrammingError: (ProgrammingError) can't adapt
'INSERT INTO public."Sources" (id, name, description) VALUES (%(id)s, %
(name)s, %(description)s)' {'description': 'b2', 'name': 'a2', 'id':
PassiveDefault(<sqlalchemy.sql.expression._TextClause object at
0x02AA3C50>)}
*****************************************************************************************
I browsed through many forums, I couldn't get a solution.
Could you assist me?


Thanks,
Nagarajan.

--~--~---------~--~----~------------~-------~--~----~
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 unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to