The problem seems to be related to a backref I had. I found a way
without using backref and now things work.

With this I get a unicode error:
acc_mapper =
mapper(ACCProtocolSpecies,acc_protocol_species_table,properties={'models':relation(Model,secondary=model_acc_protocol_table,lazy=False,backref='acc_protocols'),
 
'study_requests':relation(StudyRequest,secondary=model_acc_protocol_table,lazy=False)})
With this I don't:
acc_mapper =
mapper(ACCProtocolSpecies,acc_protocol_species_table,properties={'models':relation(Model,secondary=model_acc_protocol_table,lazy=False),
 
'study_requests':relation(StudyRequest,secondary=model_acc_protocol_table,lazy=False)})

Here is the related tg controller code:

    @expose()
    def delete(self,model_id):
        model = dbmodel.session.query(dbmodel.Model).get([model_id])
        acc_protocol_id = model.acc_protocols[0].acc_protocol_id
        species = model.acc_protocols[0].species

        record =
dbmodel.session.query(dbmodel.ModelACCProtocol).get([model_id,
acc_protocol_id, species])
        dbmodel.session.delete(record)
        dbmodel.session.delete(model)
        dbmodel.session.flush()

        return "Deleted"







On May 3, 12:04 pm, Michael Bayer <[EMAIL PROTECTED]> wrote:
> On May 3, 2007, at 11:25 AM, shday wrote:
>
>
>
>
>
>
>
> > I'm getting this error even though I have convert_unicode = True and
> > the proper NLS_LANG setting:
>
> > SQLError: (NotSupportedError) Variable_TypeByValue(): unhandled data
> > type unicode 'DELETE FROM model_acc_protocol WHERE
> > model_acc_protocol.model_id = :model_id AND
> > model_acc_protocol.acc_protocol_id = :acc_protocol_id AND
> > model_acc_protocol.color = :color' {'model_id': 60, 'color': u'RED',
> > 'acc_protocol_id': u'2001-99'}
>
> > I know my convert_unicode = True is doing something because it solved
> > others problems before. Somehow it isn't working here. One thing that
> > is different here is that the values u'RED' and u'2001-99' were pulled
> > from the database during the same flush(). In the select statement
> > just before this one these value were bound as 'RED' and '2001-99'
> > instead of unicode.
>
> those two values should not be u'' strings.  therefore it would  
> appear that those bindparams are untyped.  if you are using bindparam
> () directly, add "type=Unicode" to it.  similarly for whatever other  
> constructs youre making which arent derived from a Column, make sure  
> types are sent in as appropriate.   ( a construct derived from a  
> Column would look like mytable.c.somecolumn == u'foo', in that case  
> the Unicode type should be generated automatically).- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
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