There are lots of better ways, one would be:
count_value = db(db.table.fieldname == value)..count()
if not count_value:
# Value isn't in db do something
Terça-feira, 18 de Setembro de 2012 11:36:11 UTC+1, Hassan Alnatour
escreveu:
>
> Dear ALL ,
>
> How can a check if a value for a Field in a table , now in this i do this
>
> values = []
> for i in db().select(db.table.ALL):
> values.append(i.Field)
>
> then i check like this :
> if i in values:
> . .........
>
>
> Is there a better way to do this ??
>
> Best Regards,
>
>
--