Crans
  • Commentaires
  • Page immuable
  • Menu
    • Affichage
    • Carte locale du site
    • Pièces jointes
    • Informations
    • Code source
    • Utilisateur
    • Ajouter un lien
    • S'abonner
  • Connexion
    • Connexion
    • Paramètres

Navigation

  • Modifications récentes
  • Recherche avancée
  • Aide
CransWiki:
  • attachment:postgreSQLexemple.py de CransTechnique/CransApprentis/SeminairesTechniques/2007-2008

Pièce jointe « postgreSQLexemple.py »

Téléchargement

   1 print "toto"
   2 from sqlobject import *
   3 
   4 sqlhub.processConnection = connectionForURI('postgres:///var/run/postgresql/test')
   5 
   6 class Person(SQLObject):
   7     first_name = StringCol()
   8     last_name = StringCol()
   9     emails = MultipleJoin('Email')
  10 
  11 class Email(SQLObject):
  12     person = ForeignKey('Person')
  13     type = StringCol()
  14     address = StringCol()
  15 
  16 for table in (Person, Email):
  17         table.createTable(ifNotExists=True)
  18 
  19 
  20 adh = Person(first_name = 'toto', last_name = 'passoire')
  21 
  22 adh.first_name = 'titi'
  23 
  24 l = ["passant","passeur","baignoire"]
  25 
  26 l_adh = map(lambda x : Person(first_name = 'toto', last_name = x),l)
  27 
  28 list(Person.selectBy(last_name="baignoire"))
  29 
  30 list(Person.select(Person.q.last_name == "passoire"))
  31 
  32 list(Person.select(Person.q.last_name.startswith("passoire")))
  33 
  34 list(Person.select(RLIKE(Person.q.last_name,"^pas.*[r][a-z]?$")))
  35 
  36 q = (Person.select(RLIKE(Person.q.last_name,"^pas.*[r][a-z]?$")))
  37 list(q.orderBy('last_name'))
  38 
  39 adh2 = q.orderBy('last_name')[0]
  40 
  41 Email(type = "canonique", address = "passeur@crans.org",person = adh2)
  42 
  43 Email(type = "alias", address = "toto@crans.org",person = adh)
  44 Email(type = "autre", address = "toto.passoire@crans.org",person = adh)
  45 Email(type = "alias", address = "topasso@crans.org",person = adh)
  46 Email(type = "autre", address = "toto.passoire@dptinfo.ens-cachan.fr",person = adh)
  47 adh.emails
  48 len(adh.emails)
  49 Email(type = "autre", address = "toto.passoire@ens-cachan.fr",person = adh)
  50 len(adh.emails)
  51 
  52 q=Person.select((Email.q.type=="alias") & (Person.q.id==Email.q.personID))
  53 
  54 list(q)

Fichiers joints

Pour vous référer aux pièces jointes d'une page, utilisez attachment:filename, comme indiqué ci-dessous dans la liste de fichiers. N'utilisez pas l'URL du lien [get], car elle peut changer et donc être facilement cassée.
  • [télécharger | voir] (2018-05-26 10:59:24, 760.0 KB) [[attachment:Beamer.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:23, 1.7 KB) [[attachment:Exemple.tex]]
  • [télécharger | voir] (2018-05-26 10:59:23, 5.7 KB) [[attachment:LaTeX-CRANS.tgz]]
  • [télécharger | voir] (2018-05-26 10:59:24, 232.0 KB) [[attachment:LaTeXBase.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:24, 55.7 KB) [[attachment:TCPIP.odp]]
  • [télécharger | voir] (2018-05-26 10:59:24, 9766.2 KB) [[attachment:association.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:23, 205.3 KB) [[attachment:bcfg2.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:23, 5.0 KB) [[attachment:bcfg2.tex]]
  • [télécharger | voir] (2018-05-26 10:59:23, 90.7 KB) [[attachment:pgftikz.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:23, 326.0 KB) [[attachment:postgreSQL.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:24, 1.5 KB) [[attachment:postgreSQLexemple.py]]
  • [télécharger | voir] (2018-05-26 10:59:23, 750.3 KB) [[attachment:reseau.pdf]]
  • [télécharger | voir] (2018-05-26 10:59:24, 7404.6 KB) [[attachment:sources070913.tgz]]
 All files | Selected Files: delete move to page copy to page

Vous n'êtes pas autorisé à joindre un fichier à cette page.

  • Propulsé par MoinMoin
  • Mentions légales