from django import forms
from django.forms.utils import ValidationError

from .models import LuxOptionContract

class LuxOptionsForm(forms.ModelForm):
    contracts = forms.IntegerField()

    class Meta:
        model = LuxOptionContract
        fields = [
            'symbol', 
            'strike_price',
            'expiration_date',
            'contract_open_price',
            'call_put',
            'contracts'
        ]


class LuxOptionsUpdateForm(forms.ModelForm):
    contracts_to_close = forms.IntegerField()

    class Meta:
        model = LuxOptionContract
        fields = [
            'symbol', 
            'strike_price',
            'expiration_date',
            'contracts_to_close',
            'contract_close_price',
        ]