Beispiel #1
0
    def create_photo_album(self):
        album = Album()

        album.title_nl = _generate_title()
        album.title_en = album.title_nl

        album.date = _faker.date_between("-1y", "today")

        album.slug = slugify("-".join([str(album.date), album.title_nl]))

        if random.random() < 0.25:
            album.hidden = True
        if random.random() < 0.5:
            album.shareable = True

        album.save()

        for _ in range(random.randint(20, 30)):
            self.create_photo(album)