Added the duplex field and some other minor clean up
This commit is contained in:
@@ -19,10 +19,12 @@ class Event_Badge_Template_Base(BaseModel):
|
|||||||
id: Optional[str] = Field(None, **base_fields['event_badge_template_id_random'])
|
id: Optional[str] = Field(None, **base_fields['event_badge_template_id_random'])
|
||||||
event_badge_template_id: Optional[str] = Field(None, **base_fields['event_badge_template_id_random'])
|
event_badge_template_id: Optional[str] = Field(None, **base_fields['event_badge_template_id_random'])
|
||||||
event_id: Optional[str] = Field(None, **base_fields['event_id_random'])
|
event_id: Optional[str] = Field(None, **base_fields['event_id_random'])
|
||||||
|
account_id: Optional[str] = Field(None, **base_fields['account_id_random'])
|
||||||
|
|
||||||
# --- Standardized Legacy / Internal IDs (Excluded) ---
|
# --- Standardized Legacy / Internal IDs (Excluded) ---
|
||||||
id_random: Optional[str] = Field(None, alias='event_badge_template_id_random', exclude=True)
|
id_random: Optional[str] = Field(None, alias='event_badge_template_id_random', exclude=True)
|
||||||
event_id_random: Optional[str] = Field(None, exclude=True)
|
event_id_random: Optional[str] = Field(None, exclude=True)
|
||||||
|
account_id_random: Optional[str] = Field(None, exclude=True)
|
||||||
|
|
||||||
name: Optional[str]
|
name: Optional[str]
|
||||||
description: Optional[str]
|
description: Optional[str]
|
||||||
@@ -44,6 +46,8 @@ class Event_Badge_Template_Base(BaseModel):
|
|||||||
|
|
||||||
badge_type_list: Optional[Json]
|
badge_type_list: Optional[Json]
|
||||||
|
|
||||||
|
duplex: Optional[bool]
|
||||||
|
|
||||||
ticket_list: Optional[Json]
|
ticket_list: Optional[Json]
|
||||||
ticket_1_text: Optional[str]
|
ticket_1_text: Optional[str]
|
||||||
ticket_2_text: Optional[str]
|
ticket_2_text: Optional[str]
|
||||||
@@ -72,6 +76,10 @@ class Event_Badge_Template_Base(BaseModel):
|
|||||||
other_json: Optional[str]
|
other_json: Optional[str]
|
||||||
|
|
||||||
enable: Optional[bool]
|
enable: Optional[bool]
|
||||||
|
hide: Optional[bool]
|
||||||
|
priority: Optional[int]
|
||||||
|
sort: Optional[int]
|
||||||
|
group: Optional[str]
|
||||||
notes: Optional[str]
|
notes: Optional[str]
|
||||||
created_on: Optional[datetime.datetime] = None
|
created_on: Optional[datetime.datetime] = None
|
||||||
updated_on: Optional[datetime.datetime] = None
|
updated_on: Optional[datetime.datetime] = None
|
||||||
@@ -91,9 +99,12 @@ class Event_Badge_Template_Base(BaseModel):
|
|||||||
|
|
||||||
if e_rid := values.get('event_id_random'):
|
if e_rid := values.get('event_id_random'):
|
||||||
values['event_id'] = e_rid
|
values['event_id'] = e_rid
|
||||||
|
|
||||||
|
if a_rid := values.get('account_id_random'):
|
||||||
|
values['account_id'] = a_rid
|
||||||
|
|
||||||
# 2. Prevent "Collision Population" (ensure no integers leak into the clean string fields)
|
# 2. Prevent "Collision Population" (ensure no integers leak into the clean string fields)
|
||||||
for k in ['id', 'event_badge_template_id', 'event_id']:
|
for k in ['id', 'event_badge_template_id', 'event_id', 'account_id']:
|
||||||
if k in values and not isinstance(values[k], str) and values[k] is not None:
|
if k in values and not isinstance(values[k], str) and values[k] is not None:
|
||||||
del values[k]
|
del values[k]
|
||||||
|
|
||||||
@@ -115,22 +126,11 @@ class Event_Badge_Template_Base_In(Event_Badge_Template_Base):
|
|||||||
|
|
||||||
|
|
||||||
class Event_Badge_Template_Base_Out(Event_Badge_Template_Base):
|
class Event_Badge_Template_Base_Out(Event_Badge_Template_Base):
|
||||||
|
|
||||||
|
|
||||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||||
|
|
||||||
|
|
||||||
log.debug(locals())
|
log.debug(locals())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# log.info('Using Out template')
|
# log.info('Using Out template')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# badge_type_list: Optional[Json]
|
# badge_type_list: Optional[Json]
|
||||||
|
event_name: Optional[str]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user