Changeset 2108


Ignore:
Timestamp:
07/06/10 20:14:11 (19 months ago)
Author:
dart
Message:

LoReality?:
o Begin messager

Location:
trunk/loreality
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/loreality/loreality/model/databases.py

    r2106 r2108  
    9090        self.name = name 
    9191#---------------------------------------------------------------- 
     92class Message(Base): 
     93    __tablename__ = 'messages' 
     94    id = sa.Column(UUID(), primary_key=True,default=uuid.uuid4) 
     95    title = sa.Column(sa.types.String, nullable=False) 
     96    from_ = sa.Column(sa.types.String) 
     97    text = sa.Column(sa.types.String) 
     98    date = sa.Column(sa.types.String) 
     99    pilot_id = sa.Column(UUID(), ForeignKey('pilots.id')) 
     100#---------------------------------------------------------------- 
    92101class Pilot(Base): 
    93102    __tablename__ = 'pilots' 
     
    97106    squadron_id = sa.Column(UUID(), ForeignKey('squadrons.id')) 
    98107 
     108    messages = orm.relation("Message", backref="pilot") 
    99109 
    100110    def __init__( self, name, login ): 
  • trunk/loreality/loreality/public/style.css

    r2105 r2108  
    5555    font-size: small; 
    5656} 
     57 
     58/* MESSAGER */ 
     59.message, .from, .title, .date{ 
     60 width: 80%; 
     61 display: inline; 
     62 border: solid black 1px; 
     63 background: #AAAAAA; 
     64} 
     65.date{ 
     66    width: 20%; 
     67} 
     68.from{ 
     69    width: 30%; 
     70} 
     71.title{ 
     72    width: 50%; 
     73} 
  • trunk/loreality/loreality/templates/component/navigation.html

    r2104 r2108  
    1515        <li> <a href=${h.url_for(controller='squadron', action='index')}>Squadrons</a> </li> 
    1616        <li> <a href=${h.url_for(controller='pilot', action='index')}>Pilots</a> </li> 
     17        <li> <a href=${h.url_for(controller='messager', action='index')}>Messager</a> </li> 
    1718                % endif 
    1819</ul> 
  • trunk/loreality/loreality/websetup.py

    r2104 r2108  
    5656    squ.pilots.append( pil ) 
    5757 
     58    msg = Message() 
     59    msg.from_ = "Tolteque" 
     60    msg.date = "23/12/2010" 
     61    msg.title = "Info" 
     62    msg.text = """ 
     63    C'est super 
     64    """ 
     65    meta.Session.add( msg ) 
     66    pil.messages.append( msg ) 
     67 
    5868    pil = Pilot("Tolteque", "Tolteque") 
    5969    meta.Session.add( pil ) 
Note: See TracChangeset for help on using the changeset viewer.