You got almost there.
Try this:
```
grid = SQLFORM.grid(my_table)
num_recs = int(grid.element('.web2py_counter')[0].split()[0])
if num_recs > 1:
response.flash = T('The same zip code may exist for one or more countries')
return dict(grid=grid)
```
--
Vinicius Assef
On 1 October 2015 at 22:15, Alex Glaros <[email protected]> wrote:
> how to retrieve the number records in grid.element('.web2py_counter')?
>
> I'm looking for something like
> if grid[0][0] > 1:
> response.flash = T('The same zip code may exist for one or more
> countries')
>
> Thanks,
>
> Alex Glaros
>
> --
> 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.
--
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.