Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_empty_item_prefilled_fields(self, context: dict) -> dict:
- """Возвращает список предзаполненных полей для пустого элемента."""
- trunks_field = context.get('trunks_field')
- prefilled_fields = {
- 'trunks_field': trunks_field,
- }
- return prefilled_fields
- @classmethod
- def get_field_dict(cls, context: dict, user: User) -> dict:
- """Распаковывает ответ и возвращает словарь со значениями полей"""
- print(context)
- lv_project_id_field = TrunkLVProjectTableView.get_unpack_value(context.get('lv_project_field'))
- print(
- context.get('trunks_field'),
- context.get('lv_project_field')
- )
- lv_project_id_field = safe_to_int(lv_project_id_field, -1)
- lv_project = TrunkLVProject.objects.filter(id=lv_project_id_field).first()
- data = {
- 'lv_project': lv_project,
- 'trunks': TrunkLVProjectTableView.get_unpack_value(context.get('trunks_field'))
- }
- print(data)
- return data
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement