# Path: banking/accounts/models.py
# class Account(models.Model):
#     name = models.CharField(max_length=50)
#     balance = models.DecimalField(max_digits=65, decimal_places=2)
#     slug = models.SlugField(unique=True)
# 
#     def __str__(self):
#         return self.slug


from django import forms
from django.forms import ModelChoiceField
from .models import Account



class TransferChoiceField(ModelChoiceField):
    def label_from_instance(self, obj):
        return obj.name

class TransferForm(forms.Form):
    date = forms.DateField( widget=forms.TextInput(attrs={'class': 'ink-datepicker', 'data-start-week-day': "0", 'size': '10'}))

# Path: banking/accounts/models.py
# class Account(models.Model):
#     name = models.CharField(max_length=50)
#     balance = models.DecimalField(max_digits=65, decimal_places=2)
#     slug = models.SlugField(unique=True)
# 
#     def __str__(self):
#         return self.slug


# Path: banking/accounts/forms.py
from django import forms
from django.forms import ModelChoiceField
from .models import Account




class TransferChoiceField(ModelChoiceField):
    def label_from_instance(self, obj):
        return obj.name

class TransferForm(forms.Form):
    date = forms.DateField( widget=forms.TextInput(attrs={'class': 'ink-datepicker', 'data-start-week-day': "0", 'size': '10'}))

    from_acct = TransferChoiceField(queryset=Account.objects.all())