# Coverage for modules/box__bizhelp/contact/models.py : 71%

## 17 statements

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1 from datetime import datetime

2

3 from init import db

4

5

6 class ContactMessage(db.Model):

7

8 __tablename__ = "contact"

9 id = db.Column(db.Integer, primary_key=True)

10 created_date = db.Column(db.DateTime, default=datetime.now())

11 name = db.Column(db.String(100))

12 email = db.Column(db.String(100))

13 message = db.Column(db.String(1024))

14

15 def insert(self):

16 db.session.add(self)

17 db.session.commit()

18

19 def update(self):

20 db.session.commit()

21

22 def delete(self):

23 db.session.delete(self)

24 db.session.commit()