Exemple #1
0
 def test_field_list(self):
     fields = [
         'id', 'name', 'image_path', 'url', 'spider_name', 'spider_enabled',
         'host_name', 'country', 'shows_sold_count'
     ]
     full_fields = field_list(SITE_MODEL)
     self.assertEqual([name for (name, cls) in full_fields], fields)
Exemple #2
0
PERIOD_CHOICES = (
    ('last_7_d', ugettext_lazy('Last 7 days')),
    ('last_15_d', ugettext_lazy('Last 15 days')),
    ('last_30_d', ugettext_lazy('Last 30 days')),
    ('custom', ugettext_lazy('Custom')),
)

RESULT_TYPE_CHOICES = (
    ('sales', ugettext_lazy('Sales')),
    ('offered', ugettext_lazy('# Items Offered')),
    ('sold', ugettext_lazy('# Items Sold')),
)

ITEM_FIELDS = tuple([(field_name, field_name.replace('_', ' ').title())
                     for (field_name, field_type) in field_list(ITEM_MODEL)])

NUMERIC_FIELDS = tuple([(field_name, field_name.replace('_', ' ').title())
                        for field_name in numeric_field_list(ITEM_MODEL)])


class PasswordResetReCaptchaForm(PasswordResetForm):
    captcha = ReCaptchaField(attrs={'theme': 'clean'})


class CountryCompanyForm(forms.Form):
    country = forms.ChoiceField()
    all_companies = forms.BooleanField(required=False)
    players = forms.MultipleChoiceField(required=False,
                                        widget=forms.CheckboxSelectMultiple)
Exemple #3
0
PERIOD_CHOICES = (
    ('last_7_d', ugettext_lazy('Last 7 days')),
    ('last_15_d', ugettext_lazy('Last 15 days')),
    ('last_30_d', ugettext_lazy('Last 30 days')),
    ('custom', ugettext_lazy('Custom')),
)

RESULT_TYPE_CHOICES = (
    ('sales', ugettext_lazy('Sales')),
    ('offered', ugettext_lazy('# Items Offered')),
    ('sold', ugettext_lazy('# Items Sold')),
)

ITEM_FIELDS = tuple([(field_name, field_name.replace('_', ' ').title())
                     for (field_name, field_type)
                     in field_list(ITEM_MODEL)])

NUMERIC_FIELDS = tuple([(field_name, field_name.replace('_', ' ').title())
                        for field_name in numeric_field_list(ITEM_MODEL)])


class PasswordResetReCaptchaForm(PasswordResetForm):
    captcha = ReCaptchaField(attrs={'theme': 'clean'})


class CountryCompanyForm(forms.Form):
    country = forms.ChoiceField()
    all_companies = forms.BooleanField(required=False)
    players = forms.MultipleChoiceField(required=False,
                                        widget=forms.CheckboxSelectMultiple)
Exemple #4
0
 def test_field_list(self):
     fields = ['id', 'name', 'image_path', 'url', 'spider_name',
               'spider_enabled', 'host_name', 'country', 'shows_sold_count']
     full_fields = field_list(SITE_MODEL)
     self.assertEqual([name for (name, cls) in full_fields], fields)