Source code for shuup.admin.modules.services.base_form_part
# This file is part of Shuup.
#
# Copyright (c) 2012-2021, Shuup Commerce Inc. All rights reserved.
#
# This source code is licensed under the OSL-3.0 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.conf import settings
from shuup.admin.form_part import FormPart, TemplatedFormDef
from shuup.admin.modules.services.forms import PaymentMethodForm, ShippingMethodForm
[docs]class ServiceBaseFormPart(FormPart):
priority = -1000 # Show this first
form = None # Override in subclass
def __init__(self, *args, **kwargs):
super(ServiceBaseFormPart, self).__init__(*args, **kwargs)
[docs] def get_form_defs(self):
yield TemplatedFormDef(
"base",
self.form,
required=True,
template_name="shuup/admin/services/_edit_base_form.jinja",
kwargs={"instance": self.object, "languages": settings.LANGUAGES, "request": self.request},
)