<commit_before>from django import forms
from vote_boat.models import Poll, User


class PollForm (forms.ModelForm):    
    description = forms.CharField(max_length=300,required=False)
    # create a new user
    # username = forms.CharField(max_length=30)
    admin_user_id = forms.IntegerField
       
    class Meta:
        model = Poll
        exclude = ('admin_user_id','admin_url','participant_url','creation_date', 'update_date')
        
    def __init__ (self, *args, **kwargs):
        # style the new poll form
        forms.ModelForm.__init__(self, *args, **kwargs)
        for key in ["title","username","email"]:
            self.feilds[key].widget.attrs.update({'class' : 'vote_boat_input' })
        
        # set up the description formatting
        self.fields["description"].widget = forms.Textarea
        self.fields["description"].widget.attrs.upddate('class': 'vote_boat_text_area')
            
    
        
class UsernameForm (forms.ModelForm):
    username = forms.CharField(max_length=30,help_text="Username:")
    email = forms.EmailField(max_length=254,required=False,help_text="email:")
    
    class Meta:
        model = User
        exclude = ('account_type','first_name','last_name','is_active','creation_date','last_login_date')
        
<commit_msg>added css styling to the form<commit_after>from django import forms
from vote_boat.models import Poll, User


css_vote_boat_input = 'vote_boat_input'
css_vote_boat_text_area = "vote_boat_text_area"

class PollForm (forms.ModelForm):    
    description = forms.CharField(max_length=300,required=False)
    # create a new user
    # username = forms.CharField(max_length=30)
    admin_user_id = forms.IntegerField
       
    class Meta:
        model = Poll
        exclude = ('admin_user_id','admin_url','participant_url','creation_date', 'update_date')
        
    def __init__ (self, *args, **kwargs):
        # style the new poll form
        forms.ModelForm.__init__(self, *args, **kwargs)
        self.fields['title'].widget.attrs['class'] = [css_vote_boat_input]    
        self.fields["description"].widget = forms.Textarea(attrs={'class':css_vote_boat_text_area})
        
class UsernameForm (forms.ModelForm):
    username = forms.CharField(max_length=30,help_text="Username:")
    email = forms.EmailField(max_length=254,required=False,help_text="email:")
    
    class Meta:
        model = User
        exclude = ('account_type','first_name','last_name','is_active','creation_date','last_login_date')
    
    def __init__ (self,*args,**kwargs):
        forms.ModelForm.__init__(self, *args, **kwargs)
        self.fields['username'].widget.attrs['class'] = css_vote_boat_input 
        self.fields['email'].widget.attrs['class'] = css_vote_boat_input     



{'fraction_non_alphanumeric': 0.12549728752260397, 'fraction_numerical': 0.007233273056057866, 'mean_word_length': 3.519607843137255, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '189204', 'n_tokens_mistral': 852, 'n_tokens_neox': 822, 'n_words': 148}