from django import forms
from django.forms import ModelForm
from url_generator.models import UrlGeneratorTask, UrlGenerator, SearchStack, SearchUrlStack


class UrlGeneratorTaskModelForm(ModelForm):
    class Meta:
        model = UrlGeneratorTask
        exclude = ('date', 'links_number', 'results')

class AddUrlsForm(forms.Form):
    urls_text_area = forms.CharField(label='Add your urls list', widget=forms.Textarea)

class AddSearchUrlsForm(forms.Form):
    key = forms.CharField(label='Add YouTube key')
    #description = forms.CharField(label='Add description slug')

class ParseUrlsForm(forms.Form):
    #houce_key = forms.CharField()
    chouce_key = forms.ChoiceField(choices=tuple([(t_key.key, u' %s --- %s ' % (t_key.key, str(len(SearchUrlStack.objects.filter(key__id=t_key.id))))) for t_key in SearchStack.objects.filter(processed=True)]), label="Выбор ключа базы парсинга", initial='', widget=forms.Select(), required=True)



