예제 #1
0
파일: supplier.py 프로젝트: etoko/scm
 def to_dict(self):
     return {
         "id": self.id,
         "name": self.name,
         "created_by": self.created_by,
         "created_on": dump_datetime(self.created_on),
         "modified_by": self.modified_by,
         "modified_on": dump_datetime(self.modified_on),
     }
예제 #2
0
파일: store_issue.py 프로젝트: etoko/scm
 def to_dict(self):
     return {
       "id":                self.id,
       "requisition":       self.requisition,
       "issued_to":         self.issued_to,
       "issue_date":        self.issue_date,
       "created_by":        self.created_by,
       "created_date":      dump_datetime(self.created_date),
       "modified_by":       self.modified_by,
       "modified_date":     dump_datetime(self.modified_date),
       "store_issed_items": [item.to_dict for item in store_issue_items]
       }
예제 #3
0
파일: user.py 프로젝트: etoko/scm
 def to_dict(self):
     """
     flatten model to dict. suitable for use in jsonification
     """
     return {
       "id":            self.id,
       "username":      self.username,
       "first_name":    self.first_name,
       "last_name":     self.last_name,
       "full_name":     self.fullname,
       "email_address": self.email_address,
       "password":      self.password,
       "is_staff":      self.is_staff,
       "is_superuser":  self.is_superuser,
       "theme":         self.theme,
       "last_login":    dump_datetime(self.last_login),
       "position":      self.position,
       }