most likely get_country is failing for some reason Marin
On Wed, Feb 19, 2014 at 9:40 AM, Jason Brower <[email protected]> wrote: > I have this in the model... > import uuid > import os > import pygeoip > gi = pygeoip.GeoIP(os.path.join(request.folder, 'private', 'GeoIP.dat')) > def get_country(row): > return gi.country_code_by_addr(row.from_where) > # -*- coding: utf-8 -*- > db.define_table('melodigram_play', > Field('melodigram_id', 'reference melodigram'), > Field('when_opened', 'datetime', default = request.now), > Field('from_where', 'string', default = request.client), > Field.Virtual('from_country', lambda row: get_country(row)) > ) > db.melodigram_play.melodigram_id.requires = IS_NOT_EMPTY() > db.melodigram_play.when_opened.requires = IS_NOT_EMPTY() > > I can insert data... but when I try to retrieve it, it tells me the row > doesn't exist: > <h2>From: {{=gram_details.from_where}} : > {{=gram_details.from_country}}</h2> > ---- > gram_details.from_where has always worked. > gram_details.from_country doesn't work. > > > -- > 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/groups/opt_out. > -- 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/groups/opt_out.

