本文整理汇总了Python中film20.core.models.Film.release_year方法的典型用法代码示例。如果您正苦于以下问题:Python Film.release_year方法的具体用法?Python Film.release_year怎么用?Python Film.release_year使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类film20.core.models.Film
的用法示例。
在下文中一共展示了Film.release_year方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: initialize
# 需要导入模块: from film20.core.models import Film [as 别名]
# 或者: from film20.core.models.Film import release_year [as 别名]
def initialize(self):
self.clean_data()
film1 = Film()
film1.id = 1
film1.title = "Battlefield Earth"
film1.type = Object.TYPE_FILM
film1.permalink = "battlefield-earth-i"
film1.release_year = 2010
film1.save()
self.film1 = film1
film2 = Film()
film2.id = 2
film2.title = "Battlefield Earth II"
film2.type = Object.TYPE_FILM
film2.permalink = "battlefield-earth-ii"
film2.release_year = 2001
film2.save()
self.film2 = film2
item = Item()
item.film = film1
item.external_id = '232323'
item.url_product = 'http://www.amazonka.pl/2046_wong-kar-wai,99900073479.bhtml'
item.save()
self.item1 = item
示例2: test_filmindb
# 需要导入模块: from film20.core.models import Film [as 别名]
# 或者: from film20.core.models.Film import release_year [as 别名]
def test_filmindb(self):
"""
Test failed fetch movie in db
"""
self.initialize()
self.client.login(username=self.user.username, password='secret')
film_to_import = FilmToImport(user = self.user,
title = 'Elektroniczny Morderca',
imdb_url = 'http://www.imdb.com/title/tt0088247/',
imdb_id='0088247',
status=FilmToImport.ACCEPTED)
film_to_import.save()
film = Film()
film.title = "The Terminator"
film.type = Object.TYPE_FILM
film.imdb_code = "0088247"
film.permalink = "the-terminator"
film.release_year = 1984
film.save()
run(False, False, False, False, False, True, "http")
film_to_import = FilmToImport.objects.get(title = 'Elektroniczny Morderca')
self.assertEqual(film_to_import.attempts, 1)
self.assertEqual(film_to_import.status, FilmToImport.ALREADY_IN_DB)
示例3: initialize
# 需要导入模块: from film20.core.models import Film [as 别名]
# 或者: from film20.core.models.Film import release_year [as 别名]
def initialize(self):
self.clean_data()
film = Film()
film.title = "The Terminator"
film.type = Object.TYPE_FILM
film.imdb_code = "0088247"
film.permalink = "the-terminator"
film.release_year = 1984
film.save()
self.film = film
示例4: setUp
# 需要导入模块: from film20.core.models import Film [as 别名]
# 或者: from film20.core.models.Film import release_year [as 别名]
def setUp(self):
User.objects.all().delete()
Film.objects.all().delete()
Rating.objects.all().delete()
ShortReview.objects.all().delete()
#create sample user
user1 = User.objects.create_user('michuk',
'[email protected]',
'secret')
user1.save()
user2 = User.objects.create_user('john',
'joh[email protected]',
'secret')
user2.save()
tags = "science-fiction comedy"
#create sample user rating
film1 = Film()
film1.title = "Battlefield Earth II"
film1.type = Object.TYPE_FILM
film1.permalink = "battlefirld-earth-ii"
film1.release_year = 2010
film1.production_country_list = "USA"
film1.save()
film1.save_tags(tags, LANG="pl", saved_by=2)
film2 = Film()
film2.title = "Battlefield Earth III"
film2.type = Object.TYPE_FILM
film2.permalink = "battlefirld-earth-iii"
film2.release_year = 2011
film2.production_country_list = "USA"
film2.save()
film2.save_tags(tags, LANG="pl", saved_by=2)
film3 = Film()
film3.title = "Battlefield Earth IV"
film3.type = Object.TYPE_FILM
film3.permalink = "battlefirld-earth-iv"
film3.release_year = 2012
film3.production_country_list = "Italy"
film3.save()
film3.save_tags(tags, LANG="pl", saved_by=2)
film4 = Film()
film4.title = "Battlefield Earth V"
film4.type = Object.TYPE_FILM
film4.permalink = "battlefirld-earth-v"
film4.release_year = 2013
film4.production_country_list = "UK"
film4.save()
film4.save_tags(tags, LANG="pl", saved_by=2)
# set up test user ratings
save_rating(film1, user1, 1)
save_rating(film2, user1, 3)
save_rating(film3, user1, 4)
save_rating(film4, user1, 6)
save_rating(film2, user2, 2)
save_rating(film3, user2, 3)
save_rating(film4, user2, 5)
users = User.objects.all()
self.assertEquals(len(users), 2)
films = Film.objects.all()
self.assertEquals(len(films), 4)
user1 = users[0].id
ratings1 = Rating.objects.filter(Q(user=user1))
self.assertEquals(len(ratings1), 4)
user2 = users[1].id
ratings2 = Rating.objects.filter(Q(user=user2))
self.assertEquals(len(ratings2), 3)
reviews1 = ShortReview.objects.filter(Q(user=user1))
self.assertEquals(len(reviews1), 0)
reviews2 = ShortReview.objects.filter(Q(user=user2))
self.assertEquals(len(reviews2), 0)
示例5: initialize
# 需要导入模块: from film20.core.models import Film [as 别名]
# 或者: from film20.core.models.Film import release_year [as 别名]
def initialize(self):
self.clean_data()
# set up users
self.u1= User.objects.create_user('michuk', '[email protected]', 'secret')
self.u1.save()
self.u2 = User(username='adz', email='[email protected]')
self.u2.save()
self.u3 = User(username='turin', email='[email protected]')
self.u3.save()
self.u4 = User(username='olamus', email='[email protected]')
self.u4.save()
self.contest = Contest()
self.contest.name = "Plebiscyt"
self.contest.start_date = datetime.now()
self.contest.end_date = datetime.now()
self.contest.event_status = Contest.STATUS_OPEN
self.contest.type = Object.TYPE_CONTEST
self.contest.permalink = "plebiscyt"
self.contest.save()
film1 = Film()
film1.title = "Battlefield Earth II"
film1.type = Object.TYPE_FILM
film1.permalink = "/battlefirld-earth-ii/"
film1.release_year = 2010
film1.save()
person1 = Person()
person1.name = "John"
person1.surname = "Travolta"
person1.type = Object.TYPE_PERSON
person1.permalink = "/john-travolta/"
person1.save()
person2 = Person()
person2.name = "Tom"
person2.surname = "Cruise"
person2.type = Object.TYPE_PERSON
person2.permalink = "/tom-cruise/"
person2.save()
person3 = Person()
person3.name = "Forrest"
person3.surname = "Whitaker"
person3.type = Object.TYPE_PERSON
person3.permalink = "/forrest-whitaker/"
person3.save()
character1 = Character()
character1.character = "Scientologist 1"
character1.person = person1
character1.film = film1
character1.save()
self.character1 = character1
character2 = Character()
character2.character = "Scientologist 2"
character2.person = person2
character2.film = film1
character2.save()
self.character2 = character2
character3 = Character()
character3.character = "A non-scientologist"
character3.person = person3
character3.film = film1
character3.save()
self.character3 = character3
today = datetime.today()
tomorrow = today + timedelta(1)
self.game1 = Game()
self.game1.contest = self.contest
self.game1.type = Object.TYPE_GAME
self.game1.permalink = "scientologist-1-vs-scientologist-2"
self.game1.level = Game.LEVEL_32
self.game1.character1 = character1
self.game1.character2 = character2
self.game1.start_date = today
self.game1.end_date = today
self.game1.save()
self.game2 = Game()
self.game2.contest = self.contest
self.game2.type = Object.TYPE_GAME
self.game1.permalink = "scientologist-1-vs-scientologist-2"
self.game2.level = Game.LEVEL_32
self.game2.character1 = character1
self.game2.character2 = character2
self.game2.start_date = tomorrow
self.game2.end_date = tomorrow
self.game2.save()