コード例 #1
0
ファイル: fake_data.py プロジェクト: Changaco/liberapay.com
def fake_community(db, creator):
    """Create a fake community
    """
    name = faker.city()
    if not community.name_pattern.match(name):
        return fake_community(db, creator)

    slug = community.slugize(name)

    creator.insert_into_communities(True, name, slug)

    return community.Community.from_slug(slug)
コード例 #2
0
def fake_community(db, creator):
    """Create a fake community
    """
    name = faker.city()
    if not community.name_pattern.match(name):
        return fake_community(db, creator)

    slug = community.slugize(name)

    creator.insert_into_communities(True, name, slug)

    return community.Community.from_slug(slug)
コード例 #3
0
 def add_participant(self, participant_name):
     participant = self.make_participant(participant_name)
     participant.insert_into_communities(True, 'test', slugize('test'))
     return participant
コード例 #4
0
 def add_participant(self, participant_name):
     participant = self.make_participant(participant_name)
     participant.insert_into_communities(True, 'test', slugize('test'))
     return participant