Aha!! I don't know how I missed that before but indeed the event was
throwing an exception and GAE kept on going on its merry way. Found a
couple of things I was doing wrong. The delete event method takes only one
parameter (the query) and once you get the query you can do a straight
'select
Julian,
can you add logging to your delete_linked method to prove to yourself that
it is being called, and that it is not throwing an exception? that will
help us track down where it's gone astray
thanks!
cfh
On Sunday, November 25, 2012 5:43:16 PM UTC-8, Julian Sanchez wrote:
>
> Oh, I
Oh, I see. I thought that were you mentioned logs you were referring to
the built-in logs inside web2py (I assume there are some?). As far as my
'test app' is concerned all there is is the code I posted a couple of posts
ago. I also added these controllers for testing the deletion of records:
honestly, i'm not smart enough to use logging.conf. i'm not sure how much
of it is GAE overriding things, and how much of it is my inability to read
the docs and understand how it works! anyhow, i don't have a logging.conf
in my GAE setups, but i use logging extensively and it all seems to sho
Are there any specific things I need to do to enable logging under GAE?
This is what I did:
- renamed the logging.example.conf file to logging.conf
- added an entry for the test app I created above
- removed all references to all handlers except consoleHandler
Any page I request gives
can you add some logging in and let us know if there are exceptions?
about the delete limitations - web2py iterates over the set of items to
delete and deletes them (the version in trunk is improved over the last
release, but both still work). if the set of items to delete is large the
query t
Massimo,
I created a small test to try your function:
db.define_table('carrier',
Field('name', type='string'),
Field('description', type='string')
)
db.carrier.name.requires = IS_NOT_IN_DB(db(db.carrier.id > 0),
'carrier.name')
You can try something like
def delete_linked(query, table=table):
ids = [t.id in db(query).select(db.table.id)]
for field in table._referenced_by:
db(field._table._id.belongs(ids)).delete()
db.table._before_delete.append(delete_linked)
but you will run into consistency problems.
8 matches
Mail list logo