This commit is contained in:
@@ -42,7 +42,6 @@ def get_one(
|
||||
"""Get one contract"""
|
||||
return session.get(models.Contract, contract_id)
|
||||
|
||||
|
||||
def create_one(
|
||||
session: Session,
|
||||
contract: models.ContractCreate
|
||||
|
||||
@@ -61,6 +61,7 @@ class PaymentMethodBase(SQLModel):
|
||||
name: str
|
||||
details: str
|
||||
max: int | None
|
||||
min: int | None
|
||||
|
||||
|
||||
class PaymentMethod(PaymentMethodBase, table=True):
|
||||
|
||||
@@ -63,12 +63,14 @@ def update_one(
|
||||
if 'payment_methods' in productor_updates:
|
||||
new_productor.payment_methods.clear()
|
||||
for pm in productor_updates['payment_methods']:
|
||||
print(pm)
|
||||
new_productor.payment_methods.append(
|
||||
models.PaymentMethod(
|
||||
name=pm['name'],
|
||||
details=pm['details'],
|
||||
productor_id=id,
|
||||
max=pm['max']
|
||||
max=pm['max'],
|
||||
min=pm['min']
|
||||
)
|
||||
)
|
||||
del productor_updates['payment_methods']
|
||||
|
||||
Reference in New Issue
Block a user