Skip to content

Commit

Permalink
add user model
Browse files Browse the repository at this point in the history
  • Loading branch information
CADU110 committed Nov 30, 2023
1 parent d297951 commit 2893632
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions gestao/db/models/user.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,47 @@
from datetime import date, datetime
from typing import Optional

import ormar

from gestao.db.base import BaseMeta

import ormar

class User(ormar.Model):
class Meta(BaseMeta):
tablename = "user"

id: str = ormar.String(max_length=200, primary_key=True)
name: str = ormar.String(max_length=200)
fullName: str = ormar.String(max_length=200)
warName: str = ormar.String(max_length=200, nullable=True)
registration: str = ormar.String(max_length=200, unique=True)
birthDate: date = ormar.Date()
rg: str = ormar.String(max_length=200, unique=True)
cpf: str = ormar.String(max_length=200, unique=True)
placeOfBirth: str = ormar.String(max_length=200)
ufNatural: str = ormar.String(max_length=100)
civilState: str = ormar.String(max_length=200, nullable=True)
cep: str = ormar.String(max_length=100)
address: str = ormar.String(max_length=200)
neighborhood: str = ormar.String(max_length=200)
number: str = ormar.String(max_length=100, nullable=True)
neighborhood: str = ormar.String(max_length=100, nullable=True)
city: str = ormar.String(max_length=100)
state: str = ormar.String(max_length=100)
zipcode: str = ormar.String(max_length=100)
cpf: str = ormar.String(max_length=200, unique=True)
rg: str = ormar.String(max_length=200, unique=True)
birth_date: date = ormar.Date()
place_of_birth: str = ormar.String(max_length=200)
blood_type: str = ormar.String(max_length=200)
gender: str = ormar.String(max_length=200)
father_name: str = ormar.String(max_length=200)
mother_name: str = ormar.String(max_length=200)
position: str = ormar.String(max_length=200)
occupancy: str = ormar.String(max_length=200)
admission_date: date = ormar.Date()
situation: str = ormar.String(max_length=200)
phone: str = ormar.String(max_length=200)
complement: str = ormar.String(max_length=200, nullable=True)
uf: str = ormar.String(max_length=100)
email: str = ormar.String(max_length=200)
marital_status: str = ormar.String(max_length=200)
education: str = ormar.String(max_length=200)
registration: str = ormar.String(max_length=200, unique=True)
role: str = ormar.String(max_length=200)
category: str = ormar.String(max_length=200)
pattern: str = ormar.String(max_length=200)
status: str = ormar.String(max_length=200, default="active")
workstation: Optional[str] = ormar.String(max_length=200, nullable=True)
nickname: Optional[str] = ormar.String(max_length=200, unique=True, nullable=True)
cellphone: str = ormar.String(max_length=200)
phone: str = ormar.String(max_length=200, nullable=True)
gender: str = ormar.String(max_length=200)
motherName: str = ormar.String(max_length=200)
fatherName: str = ormar.String(max_length=200, nullable=True)
scolarity: str = ormar.String(max_length=200, nullable=True)
religion: str = ormar.String(max_length=200, nullable=True)
bloodType: str = ormar.String(max_length=200, nullable=True)
actualWorkSituation: str = ormar.String(max_length=200)
admissionDate: date = ormar.Date()
jobRole: str = ormar.String(max_length=200, nullable=True)
bodyOfLaw: str = ormar.String(max_length=200)
lotation: str = ormar.String(max_length=200, nullable=True)
workPost: str = ormar.String(max_length=200, nullable=True)
systemRole: str = ormar.String(max_length=200, nullable=True)
password: str = ormar.String(max_length=200, nullable=True)
religion: Optional[str] = ormar.String(max_length=200, nullable=True)
dispatcher: str = ormar.String(max_length=200)
dispatched_date: date = ormar.Date()
status: str = ormar.String(max_length=200, default="active")
created_at: datetime = ormar.DateTime(timezone=True, default=datetime.now)
updated_at: datetime = ormar.DateTime(
timezone=True,
Expand Down

0 comments on commit 2893632

Please sign in to comment.