MCPcopy Create free account
hub / github.com/SimHacker/micropolis / City

Class City

turbogears/micropolis/model.py:438–455  ·  view source on GitHub ↗

A city saved in the database.

Source from the content-addressed store, hash-verified

436
437
438class City(object):
439 """
440 A city saved in the database.
441 """
442
443
444 def makeCookie(self):
445 while True:
446 cookie = MakeRandomCookie().decode('utf8')
447 if not City.query.filter_by(cookie=cookie).first():
448 self.cookie = cookie
449 return
450
451
452 def destroy(self):
453
454 # TODO: clear parent pointers of sub-cities.
455 session.delete(self)
456
457
458class Product(object):

Callers 1

saveCityToDatabaseMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected