Exemple #1
0
 def init_tree(self):
     # try to create that stuff safely
     if Fifa2010().tournament is None:
         Fifa2010().tournament = GroupGame.get_or_insert(
             key_name="fifa2010", name="FIFA 2010")
     if Fifa2010().groupstage is None:
         Fifa2010().groupstage = GroupGame.get_or_insert(
             key_name="groupstage",
             name="Group Stage",
             upgroup_ref=Fifa2010().tournament)
     if Fifa2010().kostage is None:
         Fifa2010().kostage = GroupGame.get_or_insert(
             key_name="kostage",
             name="KO Stage",
             upgroup_ref=Fifa2010().tournament)
     if Fifa2010().result is None:
         Fifa2010().result = LocalUser.get_or_insert(key_name="result",
                                                     email="*****@*****.**",
                                                     password='******')
     groupgames = fifa.get_games("index")
     for game in groupgames:
         self.init_group_game(game)
     kogames = fifa.get_games("kostage")
     for kogame in kogames:
         self.init_ko_game(kogame)
Exemple #2
0
    def __init__(self):
        self.__dict__ = self.__shared_state

        # try to get stuff by key
        if self.tournament is None: self.tournament = GroupGame.get_by_key_name("uefa2012")
        if self.groupstage is None: self.groupstage = GroupGame.get_by_key_name("uefa2012groupstage")
        if self.kostage is None: self.kostage = GroupGame.get_by_key_name("uefa2012kostage")
        if self.result is None: self.result = LocalUser.get_by_key_name("result")
Exemple #3
0
 def init_tree(self):
     # try to create that stuff safely
     if Fifa2014().tournament is None: Fifa2014().tournament = GroupGame.get_or_insert(key_name="fifa2014", name="FIFA 2010")
     if Fifa2014().groupstage is None: Fifa2014().groupstage = GroupGame.get_or_insert(key_name="groupstage", name="Group Stage", upgroup_ref = Fifa2014().tournament)
     if Fifa2014().kostage is None: Fifa2014().kostage = GroupGame.get_or_insert(key_name="kostage", name="KO Stage", upgroup_ref = Fifa2014().tournament)
     if Fifa2014().result is None: Fifa2014().result = LocalUser.get_or_insert(key_name="result", email="*****@*****.**", password='******')
     groupgames = fifa.get_games("index2014")
     for game in groupgames: self.init_group_game(game)
Exemple #4
0
 def init_tree(self):
     # try to create that stuff safely
     if Uefa2012().tournament is None: Uefa2012().tournament = GroupGame.get_or_insert(key_name="uefa2012", name="UEFA 2012")
     if Uefa2012().groupstage is None: Uefa2012().groupstage = GroupGame.get_or_insert(key_name="uefa2012groupstage", name="Group Stage", upgroup_ref = Uefa2012().tournament)
     if Uefa2012().kostage is None: Uefa2012().kostage = GroupGame.get_or_insert(key_name="uefa2012kostage", name="KO Stage", upgroup_ref = Uefa2012().tournament)
     if Uefa2012().result is None: Uefa2012().result = LocalUser.get_or_insert(key_name="result", email="*****@*****.**", password='******')
     #groupgames = uefa.get_games("group")
     #for game in groupgames: self.init_group_game(game)
     kogames = uefa.get_games("kostage")
     for kogame in kogames: self.init_ko_game(kogame)
Exemple #5
0
    def __init__(self):
        self.__dict__ = self.__shared_state

        # try to get stuff by key
        if self.tournament is None:
            self.tournament = GroupGame.get_by_key_name("fifa2014")
        if self.groupstage is None:
            self.groupstage = GroupGame.get_by_key_name("groupstage")
        if self.kostage is None:
            self.kostage = GroupGame.get_by_key_name("kostage")
        if self.result is None:
            self.result = LocalUser.get_by_key_name("result")
Exemple #6
0
 def init_tree(self):
     # try to create that stuff safely
     if Uefa2012().tournament is None:
         Uefa2012().tournament = GroupGame.get_or_insert(
             key_name="uefa2012", name="UEFA 2012")
     if Uefa2012().groupstage is None:
         Uefa2012().groupstage = GroupGame.get_or_insert(
             key_name="uefa2012groupstage",
             name="Group Stage",
             upgroup_ref=Uefa2012().tournament)
     if Uefa2012().kostage is None:
         Uefa2012().kostage = GroupGame.get_or_insert(
             key_name="uefa2012kostage",
             name="KO Stage",
             upgroup_ref=Uefa2012().tournament)
     if Uefa2012().result is None:
         Uefa2012().result = LocalUser.get_or_insert(key_name="result",
                                                     email="*****@*****.**",
                                                     password='******')
     #groupgames = uefa.get_games("group")
     #for game in groupgames: self.init_group_game(game)
     kogames = uefa.get_games("kostage")
     for kogame in kogames:
         self.init_ko_game(kogame)