I think may be easier to skick an if statement in the action

if db(db.table.owner==auth.user.id).count()>=3:
    redirect(URL(...))

On May 11, 9:41 am, Arbie Samong <[email protected]> wrote:
> Hello, I was wondering if there's a way to limit the allowed number of
> insertable objects in the DAL, without the need to manually check it
> in the controller? Suppose I have a table of pineapples that is owned
> by a user, and I want the user to only be allowed three(3) pineapples?
>
> Of course that could be manually checked in the controller but I was
> wondering if there's a way to enforce it in the model layer so less
> code clutter in my controller script (I think).
>
> Thanks,
> Arbie

Reply via email to