Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/alvivi/leetelo
Browse files Browse the repository at this point in the history
  • Loading branch information
alvivi committed Dec 11, 2011
2 parents 1a05eb7 + 4eb8b27 commit cb2cd32
Showing 1 changed file with 44 additions and 10 deletions.
54 changes: 44 additions & 10 deletions tools/restart_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
akiraBook = Book(title=u'Akira', author=u'Katsuhiro Otomo',genre=u'Novela', year=1982, image=db.Link('http://ecx.images-amazon.com/images/I/51PhfWmsbzL._SL500_AA240_.jpg')).put()
panBook = Book(title=u'Pan', author=u'Knut Hamsun',genre=u'Novela', year=2010, image=db.Link('http://ecx.images-amazon.com/images/I/41gf6VVjVcL._SL500_AA240_.jpg')).put()
jtBook = Book(title=u'Canción de hielo y fuego 1: Juego de tronos', author=u'George R.R. Martin',genre=u'Novela', year=1991, image=db.Link('http://ecx.images-amazon.com/images/I/21EScU0DCEL._SL500_AA240_.jpg')).put()
#nansenBook = Book(title=u'Hacia el polo. Relato de la expedición del Fram de 1893 a 1896.', author=u'Fridtjof Nansen',genre=u'Aventuras', year=1898, image=db.Link('http:/ecx.images-amazon.com/images/I/41a79DegDuL._SS400_.jpg')).put()
nansenBook = Book(title=u'Hacia el polo. Relato de la expedición del Fram de 1893 a 1896.', author=u'Fridtjof Nansen',genre=u'Aventuras', year=1898, image=db.Link('http://ecx.images-amazon.com/images/I/41a79DegDuL._SS400_.jpg')).put()
vasiliBook = Book(title=u'Vida y Destino', author=u'Vasili Grossman',genre=u'Novela', year=1992, image=db.Link('http://ecx.images-amazon.com/images/I/51yjW-RGG8L._SL500_AA240_.jpg')).put()
beevorBook = Book(title=u'Berlín. La caída: 1945', author=u'Anthony Beevor',genre=u'Histórico', year=2002, image=db.Link('http://ecx.images-amazon.com/images/I/5123tJLTXXL._SL500_AA240_.jpg')).put()
krohgBook = Book(title=u'Albertine', author=u'Christian Krohg',genre=u'Novela', year=1886, image=db.Link('http://www.gyldendal.no/var/ezwebin_site/storage/images/gyldendal/videregaaende/studieforberedende-og-fellesfag/tilleggslitteratur/albertine/401110-3-nor-NO/Albertine_productimage.jpg')).put()
Expand All @@ -40,15 +40,19 @@
deseoBook = Book(title=u'Deseo y Engaño', author=u'Nicole Jordan',genre=u'Romántico', year=2008, image=db.Link('http://ecx.images-amazon.com/images/I/51cxReM6ETL._SL500_AA240_.jpg')).put()
tokyoBook = Book(title=u'Tokyo Blues(Norwegian wood)', author=u'Haruki Murakami',genre=u'Romántico', year=2007, image=db.Link('http://www.labitacoradeltigre.com/edu-images/tokio_blues.jpg')).put()
quienBook = Book(title=u'¿Quien te lo ha contado?', author=u'Marian Keyes',genre=u'Romántico', year=2003, image=db.Link('http://ecx.images-amazon.com/images/I/411BFxU58pL._SL500_AA240_.jpg')).put()
prisioneroBook = Book(title=u'El Prisionero del Cielo', author=u'Carlos Ruiz Zafón',genre=u'Novela', year=2010, image=db.Link('http://ecx.images-amazon.com/images/I/51eLBni5-IL._SL500_AA240_.jpg')).put()
imperioBook = Book(title=u'El Imperio eres tú', author=u'Javier Moro',genre=u'Novela', year=2010, image=db.Link('http://ecx.images-amazon.com/images/I/51I5FIliVKL._SL500_AA240_.jpg')).put()
arenaBook = Book(title=u'Tiempo de Arena', author=u'Inma Chacón',genre=u'Novela', year=2011, image=db.Link('http://ecx.images-amazon.com/images/I/51yM1aYLaoL._SL500_AA240_.jpg')).put()
libertadBook = Book(title=u'Libertad', author=u'Jonathan Franzen',genre=u'Novela', year=2011, image=db.Link('http://ecx.images-amazon.com/images/I/41jYTLPzJoL._SL500_AA240_.jpg')).put()

db.delete(Copy.all().fetch(512))
justinCopy1 = Copy(user=testUser, book=justinBook, offerType="Intercambio", offerState="Con solicitud",language="Frances",pages=250,edition=8,genre="Novela").put()
justinCopy1 = Copy(user=testUser, book=justinBook, offerType="Intercambio", offerState="Con solicitud",language="Frances",pages=250,edition=8).put()
mistCopy1 = Copy(user=nilsenUser, book=mistBook, offerType="Intercambio", offerState="Con solicitud",language="Frances",pages=200,edition=4,genre="Novela").put()
kafkaCopy1 = Copy(user=testUser, book=kafkaBook, offerType="Venta", offerState="Con solicitud",language="Ingles",pages=550,edition=9,genre="Novela").put()
cienCopy1 = Copy(user=nilsenUser, book=cienBook, offerType="Venta", offerState="Con solicitud",language="Frances",pages=255,edition=6,genre="Novela").put()
panCopy1 = Copy(user=testUser, book=panBook, offerType="Prestamo",offerState="Con solicitud",language="Frances",pages=220,edition=5,genre="Novela").put()
jtCopy1 = Copy(user=nilsenUser, book=jtBook, offerType="Prestamo",offerState="Con solicitud",language="Frances",pages=250,edition=1,genre="Novela").put()
#nansenCopy1 = Copy(user=testUser, book=nansenBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
nansenCopy1 = Copy(user=testUser, book=nansenBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
vasiliCopy1 = Copy(user=testUser, book=vasiliBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=1098,edition=8,genre="Novela").put()
beevorCopy1 = Copy(user=testUser, book=beevorBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=896,edition=8,genre="Novela").put()
krohgCopy1 = Copy(user=testUser, book=krohgBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=250,edition=8,genre="Novela").put()
Expand All @@ -64,7 +68,15 @@
decadenCopy1 = Copy(user=testUser, book=decadenBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=435,edition=8,genre="Novela").put()
mesopCopy1 = Copy(user=testUser, book=mesopBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=335,edition=8,genre="Novela").put()
rivertonCopy1 = Copy(user=testUser, book=rivertonBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()

austenCopy1 = Copy(user=nilsenUser, book=austenBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
deseoCopy1 = Copy(user=nilsenUser, book=deseoBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
tokyoCopy1 = Copy(user=nilsenUser, book=tokyoBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
quienCopy1 = Copy(user=nilsenUser, book=quienBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
cieloCopy1 = Copy(user=nilsenUser, book=cieloBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
prisioneroCopy1 = Copy(user=nilsenUser, book=prisioneroBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
imperioCopy1 = Copy(user=nilsenUser, book=imperioBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
arenaCopy1 = Copy(user=nilsenUser, book=arenaBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()
libertadCopy1 = Copy(user=nilsenUser, book=libertadBook, offerType="Intercambio", offerState="Con solicitud",language="Castellano",pages=457,edition=8,genre="Novela").put()

db.delete(Request.all().fetch(512))
Request(user=nilsenUser,copy=justinCopy1, state="Sin contestar").put()
Expand All @@ -79,18 +91,31 @@
Request(user=billyUser,copy=panCopy1, state="Sin contestar").put()
Request(user=lolUser,copy=panCopy1, state="Sin contestar").put()

#requests de testuser
Request(user=testUser,copy=austenCopy1, state="Sin contestar").put()
Request(user=testUser,copy=deseoCopy1, state="Sin contestar").put()
Request(user=testUser,copy=tokyoCopy1, state="Sin contestar").put()
Request(user=testUser,copy=quienCopy1, state="Sin contestar").put()
Request(user=testUser,copy=cieloCopy1, state="Sin contestar").put()
Request(user=testUser,copy=prisioneroCopy1, state="Sin contestar").put()
Request(user=testUser,copy=imperioCopy1, state="Sin contestar").put()
Request(user=testUser,copy=arenaCopy1, state="Sin contestar").put()
Request(user=testUser,copy=libertadCopy1, state="Sin contestar").put()



db.delete(Loan.all().fetch(512))
db.delete(Exchange.all().fetch(512))
db.delete(Sale.all().fetch(512))

db.delete(Club.all().fetch(512))
club1 = Club(name=u'aficionados de Justin',description=u'Este club es una prueba', author=u'Justin Bieber'
, genre= [u'Poesia',u'Ciencia Ficcion'],invitaciones = [u'user@example.com',u'lol@example.com'],state=u'Habilitado', book=justinBook,owner = testUser).put()
club2 = Club(name=u'Tres metros sobre el cielo',description=u'Este club va dirigido a los fans de...', author=u'Federico Moccia', genre= [u'Poesia',u'Novela'],invitaciones = [u'nilsen@example.com',u'billy@gates.com'],state=u'Deshabilitado', book=cieloBook, owner = testUser).put()
club3 = Club(name=u'fans de Haruki Murakami',description=u'Este club va dirigido a los fans de...', author=u'Haruki Murakami', genre= [u'Poesia',u'Novela'],invitaciones = [u'patriciapons89@gmail.com',u'billy@gates.com'],state=u'Habilitado', book=cieloBook, owner= testUser).put()
club4 = Club(name=u'El club de la comedia',description=u'Este club va dirigido a los fans de...', author=u'Federico Moccia', genre= [u'Narrativa',u'Biografía'],invitaciones = [u'billy@gates.com'],state=u'Habilitado', book=cieloBook, owner = nilsenUser).put()
club1 = Club(name=u'aficionados de Justin',description=u'Este club es una prueba', author=u'Justin Bieber', genre= [u'Poesia',u'Ciencia Ficcion'],invitaciones = [u'user@example.com',u'lol@example.com'],state=u'Habilitado', book=justinBook,owner = testUser, image= db.Link('http://www.studentsoftheworld.info/sites/star/img/994_JustinBieber[1].png')).put()
club2 = Club(name=u'Tres metros sobre el cielo',description=u'Este club va dirigido a los fans de...', author=u'Federico Moccia', genre= [u'Poesia',u'Novela'],invitaciones = [u'nilsen@example.com',u'billy@gates.com'],state=u'Deshabilitado', book=cieloBook, owner = testUser, image=db.Link('http://ecx.images-amazon.com/images/I/511TxpLpVYL._SL500_AA240_.jpg')).put()
club3 = Club(name=u'fans de Haruki Murakami',description=u'Este club va dirigido a los fans de...', author=u'Haruki Murakami', genre= [u'Poesia',u'Novela'],invitaciones = [u'patriciapons89@gmail.com',u'billy@gates.com'],state=u'Habilitado', book=cieloBook, owner= testUser, image=db.Link('http://2.bp.blogspot.com/__7FN-K-p0ws/TL2YKFVWofI/AAAAAAAAAMA/MK5mIMWJc1o/s1600/hmurakami.jpg')).put()
club4 = Club(name=u'El club de la comedia',description=u'Este club va dirigido a los fans de...', author=u'Federico Moccia', genre= [u'Narrativa',u'Biografía'],invitaciones = [u'billy@gates.com'],state=u'Habilitado', book=cieloBook, owner = nilsenUser, image=db.Link('http://s3.amazonaws.com/kym-assets/photos/images/original/000/096/044/trollface.jpg?1296494117')).put()
club5 = Club(name=u'Fans de Knut Hamsun',description=u'Este club va dirigido a los fans de...', author=u'Knut Hamsun', genre= [u'Narrativa',u'Biografía'],invitaciones = [u'billy@gates.com'],state=u'Habilitado', owner = nilsenUser, image=db.Link('http://farm3.static.flickr.com/2711/4437964112_b114fa90b6.jpg')).put()
club6 = Club(name=u'Intrigados por Kafka en la Orilla',description=u'Este club va dirigido a los fans de...', author=u'Haruki Murakami', genre= [u'Narrativa',u'Biografía'],invitaciones = [u'billy@gates.com'],state=u'Habilitado', book=kafkaBook, owner = nilsenUser, image=db.Link('http://ecx.images-amazon.com/images/I/31oVN6Jg8RL._SL500_AA240_.jpg')).put()
club7 = Club(name=u'Adictos a la historia',description=u'Este club va dirigido a los fans de...', genre= [u'Historico',u'Biografía'],invitaciones = [u'billy@gates.com'],state=u'Habilitado', owner = nilsenUser, image=db.Link('http://www.satlogo.com/logo/hires/cc/canal_de_historia.png')).put()

db.delete(Club_User.all().fetch(512))
Club_User(user=testUser,club=club1,state=u'Propietario').put()
Expand All @@ -104,4 +129,13 @@
Club_User(user=billyUser,club=club3,state=u'Invitado').put()
Club_User(user=testUser,club=club4,state=u'Invitacion Aceptada').put()
Club_User(user=nilsenUser,club=club4,state='Propietario').put()
Club_User(user=billyUser,club=club4,state=u'Invitado').put()
Club_User(user=billyUser,club=club4,state=u'Invitado').put()
Club_User(user=testUser,club=club5,state=u'Invitado').put()
Club_User(user=nilsenUser,club=club5,state=u'Propietario').put()
Club_User(user=billyUser,club=club5,state=u'Invitacion Aceptada').put()
Club_User(user=patryUser,club=club5,state=u'Invitacion Aceptada').put()
Club_User(user=lolUser,club=club5,state=u'Invitacion Aceptada').put()
Club_User(user=lolUser,club=club6,state=u'Propietario').put()
Club_User(user=testUser,club=club6,state=u'Invitado').put()
Club_User(user=nilsenUser,club=club7,state=u'Propietario').put()
Club_User(user=testUser,club=club7,state=u'Invitacion Aceptada').put()

0 comments on commit cb2cd32

Please sign in to comment.