Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 3 and Version 4 of IntroductionToWidgets


Ignore:
Timestamp:
04/28/06 09:51:53 (13 years ago)
Author:
michele
Comment:

some adjustements, needs more...

Legend:

Unmodified
Added
Removed
Modified
  • IntroductionToWidgets

    v3 v4  
    216216{{{ 
    217217#!python 
     218players_widget = SimpleRosterWidget() 
     219 
    218220class Root(controllers.RootController): 
    219221    @expose(template="fooball.templates.welcome") 
     
    221223        return dict(teams=Team.select(), 
    222224                    players=Player.select(), 
    223                     players_widget=SimpleRosterWidget()) 
     225                    players_widget=players_widget) 
    224226 
    225227    @expose(template="fooball.templates.team") 
    226228    def team(self, team_id, *args, **kw): 
    227229        return dict(team=Team.get(int(team_id)), 
    228                     players_widget=SimpleRosterWidget()) 
     230                    players_widget=players_widget) 
    229231}}} 
    230232 
     
    286288 * Since we've added "with_team" to the template_vars, we can use its value to determine whether or not to display the team name: 
    287289 
    288 {{{ 
    289 #!python 
    290     @expose(template="fooball.templates.team") 
    291     def team(self, team_id, *args, **kw): 
    292         return dict(team=Team.get(int(team_id)), 
    293                     players_widget=SimpleRosterWidget(with_team=False)) 
     290then inside the team template: 
     291 
     292{{{ 
     293<h2>Players</h2> 
     294${players_widget.display(team.players, with_team=False)} 
    294295}}} 
    295296