Edit trainer profile

This PR introduces a new page to edit trainer profile, the button to edit profile is available on dashboard
Just call trainer.update and I'll take care of implementing it.


On Wed, Jul 9, 2014 at 11:22 AM, Tarun Gaba <notifications@github.com>
wrote:

> In broadgauge/webapp.py:
>
> > +        form = self.FORM()
> > +        email = account.get_current_user()
> > +        user = User.find(email=email)
> > +        trainer = Trainer.find(user_id = user.id)
> > +        return render_template(self.TEMPLATE, form=form, user=user, trainer=trainer)
> > +
> > +    def POST(self):
> > +        email = account.get_current_user()
> > +        user = User.find(email=email)
> > +        trainer = Trainer.find(user_id = user.id)
> > +        i = web.input()
> > +        form = self.FORM(i)
> > +        if not form.validate():
> > +            return render_template(self.TEMPLATE, form=form, user=user, trainer=trainer)
> > +        else:
> > +            trainer.update(user.id, city=form.city.data, bio=form.bio.data, website=form.website.data)
>
> I was thinking of making a standard "update" method for both User table
> and Trainer table.
> Then we can update both of them here.
>
> something like
> else:
> trainer.update(...)
> user.update(...)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/anandology/broadgauge/pull/25/files#r14694465>.
>