Changeset 21192
- Timestamp:
- 10/12/08 19:32:54 (5 years ago)
- Location:
- lang/python/saichugen/gae
- Files:
-
- 4 modified
-
index.yaml (modified) (1 diff)
-
saichugen/main/models.py (modified) (1 diff)
-
saichugen/main/views.py (modified) (5 diffs)
-
template/index.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/python/saichugen/gae/index.yaml
r21098 r21192 10 10 # automatically uploaded to the admin console when you next deploy 11 11 # your application using appcfg.py. 12 13 # Used once in query history. 14 - kind: Game 15 properties: 16 - name: started 17 direction: desc -
lang/python/saichugen/gae/saichugen/main/models.py
r21191 r21192 4 4 started = db.DateTimeProperty() 5 5 info = db.BlobProperty() 6 memo = db.TextProperty()6 title = db.StringProperty(default="") 7 7 is_finished = db.BooleanProperty(default=False) 8 8 is_started = db.BooleanProperty(default=False) -
lang/python/saichugen/gae/saichugen/main/views.py
r21191 r21192 14 14 if user: 15 15 player = get_player_or_create(user.email()) 16 recent_games = Game.all().order("-started").fetch(10) 16 17 17 18 return HttpResponse( … … 22 23 player=player, 23 24 login_url=users.create_login_url(req.get_full_path()), 24 logout_url=users.create_logout_url(req.get_full_path()), ))) 25 logout_url=users.create_logout_url(req.get_full_path()), 26 recent_games=recent_games, ))) 25 27 26 28 def start_single_game(req): … … 45 47 from datetime import datetime 46 48 game.started = datetime.now() 47 addTimeLog(info, "System", "START_GAME")48 49 addTimeLog(info, "System", "START_ROUND", 1) 49 50 addTimeLog(info, "System", "START_TURN", 1) … … 114 115 msg = u"ターン%dが終了しました。<br/>" % option[0] 115 116 msg += turnEnd(info, option[1]) 116 117 117 118 118 time_log.append(msg) … … 174 174 if game.get_round() < 5: 175 175 addTimeLog(info, "System", "START_ROUND", game.get_round()) 176 # もしラウンドIDが5ならゲーム終了処理 176 177 177 if game.step == 15: 178 # ゲーム終了処理 178 179 game.is_finished = True 179 180 addTimeLog(info, "System", "END_GAME") -
lang/python/saichugen/gae/template/index.html
r21191 r21192 14 14 Welcome! You can <a href='{{ login_url }}'>login</a> to play new game. 15 15 {% endif %} 16 17 16 17 Recent games:<ul> 18 {% for g in recent_games %} 19 <li><a href="/game/{{ g.key.id }}/">{{ g.started|date:"Y-m-d H:i:s T" }}</a>{{ g.title }}</li> 20 {% endfor %} 21 </ul> 18 22 19 23 <p>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)