Esempio n. 1
0
 def createFilm(self):
     if self.is_valid():
         film = Film()
         film.title = self.cleaned_data.get("title")
         film.text = self.cleaned_data.get("about")
         film.photo = self.cleaned_data.get("photo")
         film.save()
         return False
     else:
         mistake = u"Форма заполнена с ошибками"
         return mistake
Esempio n. 2
0
 def create(title, author, date, type, image, synopsis, country):
     """ Create a new film """
     film = Film(title=title,
                 author=author,
                 date=date,
                 type=type,
                 image=image,
                 synopsis=synopsis,
                 country=country)
     return film.save()
Esempio n. 3
0
    def create(name, year, pos, rating, url, image):
        film = Film(
            name=name,
            year=year,
            pos=pos,
            rating=rating,
            url=url,
            image=image,
        )

        return film.save()
Esempio n. 4
0
 def create(title, date, author):
     """ Create a new film """
     film = Film(title=title, date=date, author=author)
     return film.save()
Esempio n. 5
0
    def create(title, date):
        """ Create a new film """
        film = Film(title=title, date=date)

        return film.save()