So I'm stuck again and once again -- appreciate any help. What I'm doing
it pretty simple, I think. The code runs fine -- no error messages, but
the field isn't updated as I expect. So something is borked. flag
contains an integer from 1-16. The field in the db is called f_chal1,
f_chal2, etc.
def update_scoreboard(flag):
team = auth.user.id
print flag
print team
challenge = 'f_chal' + str(flag)
print challenge
row = db(db.auth_user.id == team).select().first()
db.auth_user.challenge.writable=True
print row
row.challenge = True
row.update_record()
db.commit()
On Sunday, 19 May 2013 22:38:48 UTC-4, Chris Teodorski wrote:
>
> I will try my best here to explain what I'm after -- I'm clueless on how
> to do it. I added a custom field to db.auth_user called team_name. Each
> registered user should have a unique team name.
>
> In a seperate table, I have a team name and a list of challenges,
> 1,2,3,etc. I want the team name of this table to reference the team_name
> in auth_user. I've tried several different variations -- but each time I
> seem to either hang web2py or I get "keyed tables can only reference
> other keyed tables".
>
> my additions to auth_user look like
> this: auth.settings.extra_fields['auth_user'] = [Field('team_name')]
> my other table definition looks like this at the moment -- but I've tried
> other ways:
> db.define_table('t_teams',
> Field('name', db.auth_user.team_name),
> Field('f_chal1', type='boolean',
> label=T('Chal1')),
> Field('f_chal2', type='boolean',
> label=T('Chal2')),
> Field('f_chal3', type='boolean',
> label=T('Chal3')),
> Field('f_chal4', type='boolean',
> label=T('Chal4')),
>
> Thanks again for all the help.
>
> Chris
>
>
>
>
--
---
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.