from django.forms import ModelForm
from django.urls import reverse_lazy

from preinfo.models import Preinfo


class PreinfoBaseForm(ModelForm):
    class Meta:
        model = Preinfo
        fields = '__all__'

    # success_url = reverse_lazy('client_preinfo')
class PreinfoCreateForm(PreinfoBaseForm):
    """
    Form for creating a new PreinfoModel instance.
    Inherits from PreinfoBaseForm.
    """
    class Meta(PreinfoBaseForm.Meta):
        exclude = ['created_on',
                   'created_by',
                   'deleted',
                   'deleted_on',
                   'deleted_by',
                   'received']  # Exclude fields that should not be set by the user


class PreinfoEditForm(ModelForm):
    class Meta:
        model = Preinfo
        fields = ['container_number', 'container_type', 'line']