Hi all, according to my tests the issue is fixed on master pydal. @Lisandro, you should use master web2py which points to a version of pydal containing the fix.
Paolo On Tuesday, August 4, 2015 at 5:21:38 PM UTC+2, Massimo Di Pierro wrote: > > good catch! I opened a ticket: https://github.com/web2py/pydal/issues/262 > > On Monday, 3 August 2015 16:25:24 UTC-5, Lisandro wrote: >> >> I **think** I've found the problem. >> After some tests, I've deduced that the error is thrown when using DAL >> with lazy_tables=True. >> So when I retrieve a Row from "contenido" table, the returned object does >> not contain the "galeria_contenido" set. >> >> Is this a bug? Or I've been using lazy_tables in the wrong way? >> I ask because I've been using this code in production for a while with no >> errors, but the error only appeared when I upgrade from 2.10.3 to 2.11.2 >> (haven't checked intermediate versions). >> >> El lunes, 3 de agosto de 2015, 16:23:25 (UTC-3), Anthony escribió: >>> >>> Also, note that the error is not related to the delete method -- it is >>> occurring when trying to access >>> >>> noticia.galeria_contenido >>> >>> The "galeria_contenido" attribute of the Row object should be a Set >>> object referring to the set of records in db.galeria_contenido that >>> reference this particular row in db.contenido. For some reason, that Set >>> object is not there. >>> >>> Anthony >>> >>> On Monday, August 3, 2015 at 2:47:18 PM UTC-4, Niphlod wrote: >>>> >>>> uhm, I can't reproduce with a minimal model and 2.11.2 ...... >>>> what backend are you using ? >>>> >>>> >>>> web2py Web Framework >>>> Created by Massimo Di Pierro, Copyright 2007-2015 >>>> Version 2.11.2-stable+timestamp.2015.05.30.11.29.46 >>>> Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000 >>>> , pyodbc >>>> WARNING:web2py:import IPython error; use default python shell >>>> Python 2.7.9 (default, Dec 10 2014, 12:24:55) [MSC v.1500 32 bit (Intel >>>> )] on win >>>> 32 >>>> Type "help", "copyright", "credits" or "license" for more information. >>>> (InteractiveConsole) >>>> >>> db.define_table('contenido', Field('titulo')) >>>> <Table contenido (id,titulo)> >>>> >>> db.define_table('galeria_contenido', Field('contenido', db. >>>> contenido, ondele >>>> te='NO ACTION'), Field('titulo')) >>>> <Table galeria_contenido (id,contenido,titulo)> >>>> >>> db.contenido.insert(titulo='test') >>>> 1L >>>> >>> db.galeria_contenido.insert(contenido=1, titulo='galeria_1') >>>> 1L >>>> >>> db.galeria_contenido.insert(contenido=1, titulo='galeria_2') >>>> 2L >>>> >>> db.contenido[1] >>>> <Row {'titulo': 'test', 'id': 1L, 'galeria_contenido': <Set ( >>>> galeria_contenido.contenido = 1)>}> >>>> >>> contenido_1 = db.contenido[1] >>>> >>> contenido_1 >>>> <Row {'titulo': 'test', 'id': 1L, 'galeria_contenido': <Set ( >>>> galeria_contenido.contenido = 1)>}> >>>> >>> contenido_1.galeria_contenido.delete() >>>> 2 >>>> >>> >>>> >>>> >>>> >>>> Can you replicate the issue with this ultra-slim model ? >>>> >>>> >>>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

