Subversion Repositories SmartDukaan

Rev

Rev 132 | Rev 304 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 132 Rev 194
Line 28... Line 28...
28
    shopping_cart_id = Field(Integer)
28
    shopping_cart_id = Field(Integer)
29
    payments = OneToMany("Payment")
29
    payments = OneToMany("Payment")
30
    shipments = OneToMany("Shipment")
30
    shipments = OneToMany("Shipment")
31
    lineitems = OneToMany("LineItem")
31
    lineitems = OneToMany("LineItem")
32
    trails = OneToMany("TransactionTrail")
32
    trails = OneToMany("TransactionTrail")
33
    def __repr__(self):
33
    
34
        return "Transaction: id %d" % (self.id)
-
 
35
 
34
 
36
 
35
 
37
class Payment(Entity):
36
class Payment(Entity):
38
    #using_options(auto_primarykey=False)
37
    #using_options(auto_primarykey=False)
39
    id = Field(Integer, primary_key=True, autoincrement=True)
38
    id = Field(Integer, primary_key=True, autoincrement=True)
Line 125... Line 124...
125
    timestamp = Field(DateTime)
124
    timestamp = Field(DateTime)
126
    transaction = ManyToOne("Transaction")
125
    transaction = ManyToOne("Transaction")
127
    
126
    
128
 
127
 
129
def initialize():
128
def initialize():
130
    metadata.bind = "sqlite:///Transactionsnew.sqlite"
129
    metadata.bind = "sqlite:///Transactionsnew-elite.sqlite"
131
    metadata.bind.echo = True
130
    metadata.bind.echo = True
132
    setup_all(True)
131
    setup_all(True)
133
 
132
 
134
 
133
 
135
if __name__=="__main__":
134
if __name__=="__main__":