Hi Paolo, but how do you find the tables (and records) that use the deleted
record as a Foreign Key?
I don't know if those records should have the "is_active" set to False, or
the Foreign Key set to None
On Tuesday, 10 March 2015 07:34:22 UTC, Paolo Valleri wrote:
>
> ondelete is for reference
ondelete is for reference field.
At a first sight, a possible workaround would be to write your own
'ondelete' by using the _before_delete and _after_delete callbacks
Paolo
On Monday, March 9, 2015 at 7:09:54 PM UTC+1, Ron Chatterjee wrote:
>
> Wonder if he can try to make it a list and do list.
Wonder if he can try to make it a list and do list.remove?
Have you tried that?
On Thursday, March 20, 2014 at 3:07:47 PM UTC-4, Leonel Câmara wrote:
>
> I think you should have a third table anyway or searches for T-shirts of a
> given colour will be quite slow.
>
--
Resources:
- http://web2p
Hi ANdré, did you find a way to solve this?
On Thursday, 20 March 2014 22:10:33 UTC, André Kablu wrote:
>
> Yes just migrated to mongodb, and there really exist some issue.
>
> using CASCADE or SET NULL, it does not matter, web2py does not respect and
> remove the reference from the referencing c
you're all forgetting that:
- relational database do have FK working
- sqlite is not properly relational in matters of FK, unless you're working
with a recent app (foreign key support was introduced by default in a
recent release) and a fresh database
- list:reference is not something baked in th
You're right, the update is defined on the field like you have. I have used
'NO ACTION' on a reference field with no issues. However never tried it
'SET NULL' on a List:reference. I spoke too soon.
On Friday, March 21, 2014 1:21:34 PM UTC-4, André Kablu wrote:
>
> I think you are mistaken...
>
I think you are mistaken...
ondelete is for use with upload and reference fields...
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Field-constructor
On Fri, Mar 21, 2014 at 1:54 PM, PN wrote:
> Your desired behavior is that when a color is deleted it should be s
Your desired behavior is that when a color is deleted it should be set to
null in tshirts, so you need to put the ondelete attribute in the color
field in the color table instead of on the colors field in the tshirt table.
db.define_table('color',
Field('color', 'string',
Yes just migrated to mongodb, and there really exist some issue.
using CASCADE or SET NULL, it does not matter, web2py does not respect and
remove the reference from the referencing collection or delete the
reference...
Em quinta-feira, 20 de março de 2014 16h16min43s UTC-3, André Kablu
esc
I will migrate it later to mongodb, but wanted it to work on sqlite too for
dev, and not have to create a lot of validators on each delete or update.
That`s why I was wondering if web2py can handle this transparently.
On Thu, Mar 20, 2014 at 4:07 PM, Leonel Câmara wrote:
> I think you should h
I think you should have a third table anyway or searches for T-shirts of a
given colour will be quite slow.
--
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)
--
11 matches
Mail list logo