text
stringlengths
0
1.05M
meta
dict
from django import forms from .models import LEVELS, Question, Answer class UserResponseForm(forms.Form): question_id = forms.IntegerField() answer_id = forms.IntegerField() importance_level = forms.ChoiceField(choices=LEVELS) their_answer_id = forms.IntegerField() their_importance_level = forms.C...
{ "repo_name": "loafbaker/django_matchmaker", "path": "questions/forms.py", "copies": "1", "size": "1379", "license": "mit", "hash": 8717691601169326000, "line_mean": 36.2702702703, "line_max": 122, "alpha_frac": 0.6359680928, "autogenerated": false, "ratio": 4.020408163265306, "config_test": fa...
from django import forms from .models import Location, Category, Type, Author class DisplayableForm(forms.ModelForm): title = forms.CharField(max_length=100, required=True, widget=forms.Textarea(attrs={'rows': 1, 'cols': 40})) description = forms.CharField(max_length=500, required=True, widget=forms.Textarea...
{ "repo_name": "RuralIndia/pari", "path": "pari/article/forms.py", "copies": "1", "size": "1078", "license": "bsd-3-clause", "hash": -6197576961520480000, "line_mean": 24.6666666667, "line_max": 118, "alpha_frac": 0.6549165121, "autogenerated": false, "ratio": 3.6053511705685617, "config_test": ...
from django import forms from .models import ( Attribute, Class, CountableAttribute, CountableIntervallicAttribute, Instance, IntervallicAttribute, Key, ) class AttributeForm(forms.ModelForm): def __init__(self, user, app, *args, **kwargs): self.o = Object.objects.create( ...
{ "repo_name": "dogukantufekci/memo", "path": "memo/objects/forms.py", "copies": "1", "size": "3502", "license": "mit", "hash": 3935194981470100500, "line_mean": 23.4965034965, "line_max": 80, "alpha_frac": 0.5459737293, "autogenerated": false, "ratio": 3.8065217391304347, "config_test": false, ...
from django import forms from .models import * from server.models import * class ChoiceFieldNoValidation(forms.ChoiceField): def validate(self, value): pass class SaveSearchForm(forms.ModelForm): class Meta: model = SavedSearch fields = ('name',) class SearchRowForm(forms.ModelForm):...
{ "repo_name": "erikng/sal", "path": "search/forms.py", "copies": "1", "size": "1482", "license": "apache-2.0", "hash": 144907077496891000, "line_mean": 27.5, "line_max": 87, "alpha_frac": 0.5829959514, "autogenerated": false, "ratio": 3.952, "config_test": false, "has_no_keywords": false, "...
from django import forms from .models import * from server.models import * class ChoiceFieldNoValidation(forms.ChoiceField): def validate(self, value): pass class SaveSearchForm(forms.ModelForm): class Meta: model = SavedSearch fields = ('name',) class SearchRowForm(forms.ModelFor...
{ "repo_name": "salopensource/sal", "path": "search/forms.py", "copies": "2", "size": "1308", "license": "apache-2.0", "hash": -565697258333980200, "line_mean": 28.0666666667, "line_max": 88, "alpha_frac": 0.6093272171, "autogenerated": false, "ratio": 3.9397590361445785, "config_test": false, ...
from django import forms from .models import * EFFECT_CHOICES = ( ('Crop','Crop'), ('Enhance','Enhance'), ('Resize','Resize'), ('Rotate','Rotate'), ('RoundCorners','Round Corners'), ('Scale','Scale'), ('SmartScale','Smart Scale'), ) class EffectMixin: def __init__(self,*args,**kwargs): supe...
{ "repo_name": "devalfrz/django-image-styles", "path": "image_styles/forms.py", "copies": "1", "size": "1553", "license": "bsd-2-clause", "hash": -6253971191845587000, "line_mean": 23.6507936508, "line_max": 90, "alpha_frac": 0.6252414681, "autogenerated": false, "ratio": 3.8535980148883375, "co...
from django import forms from .models import * class CarreraForm(forms.ModelForm): class Meta: model = Carrera fields = ['sede', 'facultad', 'codigo_carrera', 'carrera'] class AsignaturaForm(forms.ModelForm): class Meta: model = Asignatura fields = [ 'carrera', 'codigo', 'nombre', 'coordinado...
{ "repo_name": "Mansilla1/Sistema-SEC", "path": "apps/contenidos/forms.py", "copies": "1", "size": "1746", "license": "apache-2.0", "hash": 8364113830069191000, "line_mean": 16.8163265306, "line_max": 67, "alpha_frac": 0.627720504, "autogenerated": false, "ratio": 2.4149377593360994, "config_tes...
from django import forms from models import * # control models class AttributeForm(forms.ModelForm): class Meta: model = Attribute fields = ('name', ) widgets = { 'name': forms.TextInput(attrs={'class': 'form-control name'}) } class BrandForm(forms.ModelForm): ...
{ "repo_name": "vforgione/dodger", "path": "app/forms.py", "copies": "1", "size": "13747", "license": "mit", "hash": 8689444476712073000, "line_mean": 43.6331168831, "line_max": 131, "alpha_frac": 0.6006401397, "autogenerated": false, "ratio": 4.080439299495399, "config_test": false, "has_no_k...
from django import forms from .models import PageNode, PAGE_MODEL_CLASSES def template_choices(): """List out the template names for the admin.""" return [('', '---------')] + [(m.identifier, m._meta.verbose_name.title()) for m in PAGE_MODEL_CLASSES] class PageAdminForm(forms.ModelForm): """Page admin...
{ "repo_name": "gsmke/django-leaf", "path": "leaf/forms.py", "copies": "1", "size": "1312", "license": "bsd-3-clause", "hash": -8938469188236747000, "line_mean": 29.511627907, "line_max": 107, "alpha_frac": 0.6318597561, "autogenerated": false, "ratio": 4.417508417508418, "config_test": false, ...
from django import forms from .models import PassType, Registration class SignupForm(forms.ModelForm): pass_type = forms.ModelChoiceField( queryset=PassType.objects.filter(active=True), widget=forms.widgets.RadioSelect(), ) class Meta: model = Registration fields = ( ...
{ "repo_name": "smokeyfeet/smokeyfeet-registration", "path": "src/smokeyfeet/registration/forms.py", "copies": "1", "size": "2149", "license": "mit", "hash": -2629897977253883400, "line_mean": 29.7, "line_max": 79, "alpha_frac": 0.5914378781, "autogenerated": false, "ratio": 4.205479452054795, "...
from django import forms from .models import Payment, PaymentProxy class PaymentForm(forms.ModelForm): class Meta: model = Payment fields = ('title', 'description', 'objective', 'amount', 'due') def __init__(self, *args, **kwargs): super(PaymentForm, self).__init__(*args, **kwargs) ...
{ "repo_name": "MilyMilo/sci-organizer", "path": "accounting/forms.py", "copies": "1", "size": "2237", "license": "mit", "hash": 4140045547915628000, "line_mean": 30.0694444444, "line_max": 71, "alpha_frac": 0.4787662047, "autogenerated": false, "ratio": 4.277246653919694, "config_test": false, ...
from django import forms from .models import Photographer, Cosplayer from .utils import horizontal_form_helper class PhotographerForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(PhotographerForm, self).__init__(*args, **kwargs) self.helper = horizontal_form_helper() self...
{ "repo_name": "conikuvat/shoottikala", "path": "shoottikala/forms.py", "copies": "1", "size": "1943", "license": "mit", "hash": 5434475499163912000, "line_mean": 27.0724637681, "line_max": 104, "alpha_frac": 0.5699535364, "autogenerated": false, "ratio": 3.753875968992248, "config_test": false,...
from django import forms from .models import Planner from planner.scheduler_type import SCHEDULER_TYPE, START_TYPE class PlannerModelForm(forms.ModelForm): class Meta: model = Planner exclude = () class PlannerForm(forms.Form): BIRTH_YEAR_CHOICES = ('1980', '1981', '1982') FAVORITE_COLOR...
{ "repo_name": "elcolie/halfglass", "path": "planner/forms.py", "copies": "1", "size": "1204", "license": "mit", "hash": -2126069029635521000, "line_mean": 37.8709677419, "line_max": 146, "alpha_frac": 0.6303986711, "autogenerated": false, "ratio": 3.774294670846395, "config_test": false, "has...
from django import forms from .models import Pop class PainelModelForm(forms.ModelForm): layout = forms.CharField( label='Layout', widget=forms.Textarea( attrs={'max_length': 4096, 'rows': 10, 'cols': 79})) class InformacaoModuloModelForm(forms.ModelForm): texto = forms.CharFiel...
{ "repo_name": "anselmobd/fo2", "path": "src/geral/forms.py", "copies": "1", "size": "1848", "license": "mit", "hash": -3367290842172664000, "line_mean": 28.2063492063, "line_max": 76, "alpha_frac": 0.5880434783, "autogenerated": false, "ratio": 3.376146788990826, "config_test": false, "has_no...
from django import forms from .models import Product, Tag class TagChoiceField(forms.ModelChoiceField): def __init__(self, *args, **kwargs): kwargs.setdefault('empty_label', 'Any') super(TagChoiceField, self).__init__(*args, **kwargs) def label_from_instance(self, obj): return obj.va...
{ "repo_name": "giovannicode/djangoseller", "path": "products/forms.py", "copies": "1", "size": "2611", "license": "bsd-3-clause", "hash": 8059951064793445000, "line_mean": 44.0172413793, "line_max": 111, "alpha_frac": 0.7230945998, "autogenerated": false, "ratio": 3.621359223300971, "config_tes...
from django import forms from .models import Profile class BaseProfileForm(forms.Form): first_name = forms.CharField(label='Your First Name', max_length=30, required=False) last_name = forms.CharField(label='Your Last Name', max_length=30, requ...
{ "repo_name": "compsci-hfh/app", "path": "project/profiles/forms.py", "copies": "2", "size": "1181", "license": "mit", "hash": -4209607269206414000, "line_mean": 35.90625, "line_max": 85, "alpha_frac": 0.6071126164, "autogenerated": false, "ratio": 4.114982578397212, "config_test": false, "ha...
from django import forms from .models import Profile class ProfileForm(forms.ModelForm): """ A form for editing user profiles. Assumes that the Profile instance passed in has an associated User object. The view (see views.py) takes care of tha """ name = forms.CharField( required=Fal...
{ "repo_name": "nanuxbe/django", "path": "accounts/forms.py", "copies": "10", "size": "1128", "license": "bsd-3-clause", "hash": -1545753700534978300, "line_mean": 28.6842105263, "line_max": 83, "alpha_frac": 0.6072695035, "autogenerated": false, "ratio": 4.305343511450381, "config_test": false,...
from django import forms from .models import Profile class RegistrationForm(forms.ModelForm): email = forms.EmailField(widget=forms.widgets.EmailInput) password1 = forms.CharField( widget=forms.PasswordInput(), label="Password", min_length=8 ) password2 = forms.CharField( ...
{ "repo_name": "martinstastny/django-simplestore", "path": "simplestore/profiles/forms.py", "copies": "2", "size": "1282", "license": "mit", "hash": 6585899024703402000, "line_mean": 28.1363636364, "line_max": 81, "alpha_frac": 0.6427457098, "autogenerated": false, "ratio": 4.231023102310231, "c...
from django import forms from models import ProjectDetail, Institute class ProjectDetailForm(forms.ModelForm): class Meta: model = ProjectDetail exclude = ( 'institute', 'proj_leader', 'record_status', 'reporting_period', 'is_rejected', 'rejected_detail', 'is_flagged', 'is_...
{ "repo_name": "Code4SA/herana", "path": "herana/forms.py", "copies": "1", "size": "5713", "license": "mit", "hash": -7377389972326443000, "line_mean": 51.4128440367, "line_max": 127, "alpha_frac": 0.5781550849, "autogenerated": false, "ratio": 4.095340501792115, "config_test": false, "has_no_...
from django import forms from .models import Quiz class QuickQuizCreate(forms.Form): title = forms.CharField(widget=forms.TextInput(attrs={'required':'required'}),max_length=200) password1 = forms.CharField(widget=forms.PasswordInput(attrs={'required':'required'}), min_length=5, label="Password") password2 = forms...
{ "repo_name": "ikedumancas/ikequizgen", "path": "quizzes/forms.py", "copies": "1", "size": "2120", "license": "mit", "hash": -3689702898262039000, "line_mean": 46.1333333333, "line_max": 128, "alpha_frac": 0.7495283019, "autogenerated": false, "ratio": 3.557046979865772, "config_test": false, ...
from django import forms from .models import Resource, Volunteer class SignUpForm(forms.ModelForm): class Meta: model = Volunteer fields = ('real_name', 'email_address', 'phone_number') labels = {'real_name': 'Full Name'} def __init__(self, *args, **kwargs): resources = kwarg...
{ "repo_name": "thomasleese/rooster", "path": "scheduler/forms.py", "copies": "1", "size": "1757", "license": "mit", "hash": 7116447940109394000, "line_mean": 34.8571428571, "line_max": 83, "alpha_frac": 0.4957313603, "autogenerated": false, "ratio": 4.907821229050279, "config_test": false, "h...
from django import forms from .models import Result, SessionRound class ResultForm(forms.ModelForm): class Meta: model = Result exclude = ('match', 'seed') class SetupForm(forms.Form): SPREAD_CHOICES = ( ('', 'No special options'), ('expanded', 'One target per archer'), ...
{ "repo_name": "mjtamlyn/archery-scoring", "path": "olympic/forms.py", "copies": "1", "size": "3102", "license": "bsd-3-clause", "hash": -1449581490440705300, "line_mean": 34.6551724138, "line_max": 93, "alpha_frac": 0.5531914894, "autogenerated": false, "ratio": 3.7554479418886197, "config_test...
from django import forms from .models import Review, Employee from registration.forms import RegistrationFormUniqueEmail #this is to edit the registration redux form # class ReviewForm(forms.ModelForm): # class Meta: # model = Review # fields = [ # "content", # "employee", # "work_again", # ] #actual rev...
{ "repo_name": "junaidq1/greendot", "path": "src/reviews/forms.py", "copies": "1", "size": "4047", "license": "mit", "hash": -103339035556421940, "line_mean": 32.4462809917, "line_max": 109, "alpha_frac": 0.6869285891, "autogenerated": false, "ratio": 3.0111607142857144, "config_test": false, ...
from django import forms from .models import Review class ReviewForm(forms.models.ModelForm): def __init__(self, *args, **kwargs): super(ReviewForm, self).__init__(*args, **kwargs) self.fields['name'].required = True class Meta: model = Review fields = ['name', 'rating', 'te...
{ "repo_name": "kevgathuku/compshop", "path": "store/forms.py", "copies": "2", "size": "1066", "license": "bsd-3-clause", "hash": 7964700157079420000, "line_mean": 31.303030303, "line_max": 71, "alpha_frac": 0.4718574109, "autogenerated": false, "ratio": 4.716814159292035, "config_test": false, ...
from django import forms from .models import Revision class RevisionForm(forms.ModelForm): revision_pk = forms.IntegerField(required=False, widget=forms.HiddenInput()) message = forms.CharField(required=False, help_text="Leave a helpful message about your change") def __init__(self, *args, **kwargs): ...
{ "repo_name": "pinax/pinax-wiki", "path": "pinax/wiki/forms.py", "copies": "1", "size": "1315", "license": "mit", "hash": -7864570346795626000, "line_mean": 34.5405405405, "line_max": 100, "alpha_frac": 0.6273764259, "autogenerated": false, "ratio": 4.383333333333334, "config_test": false, "h...
from django import forms from .models import Sample, SampleType class contactForm(forms.Form): returnEmail = forms.EmailField(max_length = 200, label = 'Your email address') body = forms.CharField(required=True, label = 'Your message', widget=forms.Textarea(attrs={'class':'...
{ "repo_name": "kyledmellander/spectroscopy", "path": "src/mars/forms.py", "copies": "1", "size": "2544", "license": "mit", "hash": 6012296229249093000, "line_mean": 47.9230769231, "line_max": 131, "alpha_frac": 0.6772798742, "autogenerated": false, "ratio": 3.808383233532934, "config_test": fal...
from django import forms from .models import Satellite # This is the maximum number of tasks per user across all apps. # A value of `None` indicates no limit. MAX_NUM_TASKS_PER_USER = None # This is the maximum number of years in a query. MAX_NUM_YEARS = 100 class DataSelectionForm(forms.Form): two_column_format...
{ "repo_name": "ceos-seo/data_cube_ui", "path": "apps/dc_algorithm/forms.py", "copies": "1", "size": "7685", "license": "apache-2.0", "hash": 1725491283782129400, "line_mean": 49.9006622517, "line_max": 128, "alpha_frac": 0.5752765127, "autogenerated": false, "ratio": 4.160801299404439, "config_...
from django import forms from .models import Signup from .models import Contact from .models import BookBearLetter class ContactForm(forms.ModelForm): class Meta: model = Contact fields = ['fullname','phone_number','email','message'] widgets={ "fullname":forms.TextInput(attrs={'placeholder':'Fullname'}), ...
{ "repo_name": "raptattention/booksbeyondmagazine", "path": "src/newsletter/forms.py", "copies": "1", "size": "1119", "license": "mit", "hash": -8718593765889977000, "line_mean": 27.7179487179, "line_max": 73, "alpha_frac": 0.7006255585, "autogenerated": false, "ratio": 3.656862745098039, "confi...
from django import forms from .models import SocialAccount class SocialAccountAdminForm(forms.ModelForm): class Meta: model = SocialAccount exclude = () widgets = { 'raw_identifier': forms.HiddenInput() } labels = { 'raw_identifier': '' } ...
{ "repo_name": "chrisforrette/django-social-content", "path": "social_content/forms.py", "copies": "1", "size": "1150", "license": "mit", "hash": -658021323214673200, "line_mean": 36.0967741935, "line_max": 171, "alpha_frac": 0.5826086957, "autogenerated": false, "ratio": 4.4921875, "config_test...
from django import forms from .models import Subscriber, InvitationToken class SubscriberForm(forms.ModelForm): class Meta: model = Subscriber fields = ('first_name', 'last_name', 'email') def clean_email(self): data = self.cleaned_data['email'] if Subscriber.objects.filter(...
{ "repo_name": "mariocesar/django-rocket", "path": "django_rocket/forms.py", "copies": "1", "size": "1214", "license": "mit", "hash": -8499575948336375000, "line_mean": 28.6097560976, "line_max": 89, "alpha_frac": 0.6285008237, "autogenerated": false, "ratio": 4.274647887323944, "config_test": f...
from django import forms from .models import SurveyAnswer, SurveyQuestion, WaitingListEntry from .signals import answered_survey class WaitingListEntryForm(forms.ModelForm): class Meta: model = WaitingListEntry fields = [ "email" ] def clean_email(self): value = ...
{ "repo_name": "rizumu/pinax-waitinglist", "path": "pinax/waitinglist/forms.py", "copies": "1", "size": "1991", "license": "mit", "hash": -3427114229879572000, "line_mean": 34.5535714286, "line_max": 86, "alpha_frac": 0.5856353591, "autogenerated": false, "ratio": 4.375824175824176, "config_test...
from django import forms from .models import SurveyAnswer, SurveyQuestion, WaitingListEntry from .signals import answered_survey class WaitingListEntryForm(forms.ModelForm): referrer = forms.CharField(required=False, widget=forms.HiddenInput()) campaign = forms.CharField(required=False, widget=forms.HiddenI...
{ "repo_name": "pinax/pinax-waitinglist", "path": "pinax/waitinglist/forms.py", "copies": "1", "size": "2367", "license": "mit", "hash": 3846894108414501400, "line_mean": 33.3043478261, "line_max": 86, "alpha_frac": 0.5745669624, "autogenerated": false, "ratio": 4.5606936416184976, "config_test"...
from django import forms from .models import Tenant, BackendLink class TenantForm(forms.ModelForm): backend_link = forms.ModelChoiceField(queryset=BackendLink.all_tenants.none(), required=False) class Meta: model = Tenant fields = ('name', 'slug', 'd...
{ "repo_name": "theirc/rapidsms-multitenancy", "path": "multitenancy/forms.py", "copies": "1", "size": "1543", "license": "bsd-3-clause", "hash": -8468556479022768000, "line_mean": 41.8611111111, "line_max": 90, "alpha_frac": 0.6267012314, "autogenerated": false, "ratio": 4.192934782608695, "con...
from django import forms from .models import Topic, Post from .settings import COMMENT_PLACEHOLDER class AddTopicForm(forms.ModelForm): """ Form for adding a new topic. """ text = forms.CharField(widget=forms.Textarea(attrs={'tabindex': '2', 'placeholder': COMMENT_PLACEHOLDER})) image = forms.C...
{ "repo_name": "tBaxter/django-fretboard", "path": "fretboard/forms.py", "copies": "1", "size": "1206", "license": "mit", "hash": 7958851188122910000, "line_mean": 27.7142857143, "line_max": 111, "alpha_frac": 0.5754560531, "autogenerated": false, "ratio": 3.9283387622149837, "config_test": fals...
from django import forms from .models import Unite, FicheAction class PreinscriptionForm(forms.ModelForm): class Meta: model = Unite fields = ('branche', 'nom', 'inscr_explogram', 'inscr_congram', 'inscr_tangram', 'etat_explogram', 'effectif') class Fichgram1Form(forms.ModelForm): ...
{ "repo_name": "gutard/django-tangram", "path": "tangram/forms.py", "copies": "1", "size": "1751", "license": "bsd-3-clause", "hash": -2183453703877850000, "line_mean": 22.9863013699, "line_max": 76, "alpha_frac": 0.6133637921, "autogenerated": false, "ratio": 3.018965517241379, "config_test": f...
from django import forms from .models import UserProfile class UserProfileForm(forms.ModelForm): first_name = forms.CharField(label='First name', max_length=30, required=False) last_name = forms.CharField(label='Last name', max_length=30, required=False) email = forms.EmailField(label='Email', required=F...
{ "repo_name": "kosior/eventful", "path": "eventful/userprofiles/forms.py", "copies": "1", "size": "1268", "license": "mit", "hash": 3289924659177643500, "line_mean": 37.4242424242, "line_max": 83, "alpha_frac": 0.6593059937, "autogenerated": false, "ratio": 3.686046511627907, "config_test": fal...
from django import forms from .models.user import User class CheckCreditForm(forms.Form): card = forms.CharField(max_length=100, widget=forms.PasswordInput(attrs={'autofocus': 'autofocus'})) class AddCreditForm(forms.Form): credit = forms.CharField(widget=forms.NumberInput(attrs={'autofocus': 'autofocus'})...
{ "repo_name": "nuxis/p0sX-server", "path": "pos/forms.py", "copies": "1", "size": "1110", "license": "mit", "hash": 4510467356780484600, "line_mean": 29, "line_max": 131, "alpha_frac": 0.6441441441, "autogenerated": false, "ratio": 3.76271186440678, "config_test": false, "has_no_keywords": fa...
from django import forms from mozbadges.forms.models import GroupedModelChoiceField from mozbadges.site.people.models import Person, Community class UserProfileForm(forms.ModelForm): username = forms.CharField( help_text='') display_name = forms.CharField( requ...
{ "repo_name": "mozilla/mozilla-badges", "path": "mozbadges/site/account/forms.py", "copies": "1", "size": "2299", "license": "bsd-3-clause", "hash": -3970924700932985000, "line_mean": 39.3333333333, "line_max": 131, "alpha_frac": 0.5793823401, "autogenerated": false, "ratio": 4.711065573770492, ...
from django import forms from mozdns.forms import BaseForm from mozdns.nameserver.models import Nameserver from mozdns.address_record.models import AddressRecord from core.interface.static_intr.models import StaticInterface class NameserverForm(BaseForm): class Meta: model = Nameserver exclude = ...
{ "repo_name": "rtucker-mozilla/mozilla_inventory", "path": "mozdns/nameserver/forms.py", "copies": "1", "size": "1677", "license": "bsd-3-clause", "hash": 8636306477749690000, "line_mean": 35.4565217391, "line_max": 72, "alpha_frac": 0.6237328563, "autogenerated": false, "ratio": 3.79411764705882...
from django import forms from mozdns.forms import BaseForm from mozdns.nameserver.models import Nameserver from mozdns.address_record.models import AddressRecord from core.registration.static.models import StaticReg class NameserverForm(BaseForm): class Meta: model = Nameserver exclude = ('addr_g...
{ "repo_name": "rtucker-mozilla/inventory", "path": "mozdns/nameserver/forms.py", "copies": "2", "size": "1846", "license": "bsd-3-clause", "hash": -1673593766902767400, "line_mean": 35.92, "line_max": 72, "alpha_frac": 0.6110509209, "autogenerated": false, "ratio": 3.76734693877551, "config_tes...
from django import forms from mtr.utils.forms import GlobalInitialFormMixin from mtr.utils.helpers import model_choices from .lib.manager import manager from .models import Settings, Field # TODO: refactor class SettingsAdminForm(GlobalInitialFormMixin, forms.ModelForm): class Meta: exclude = tuple()...
{ "repo_name": "mtrgroup/django-mtr-sync", "path": "mtr/sync/forms.py", "copies": "1", "size": "2076", "license": "mit", "hash": -8812353900138153000, "line_mean": 33.0327868852, "line_max": 71, "alpha_frac": 0.616088632, "autogenerated": false, "ratio": 4.298136645962733, "config_test": false, ...
from django import forms from multiform import MultiForm, MultiModelForm, InvalidArgument from .models import Pizza, Topping class EmptyForm(forms.Form): pass class FooForm(forms.Form): foo = forms.CharField() class HiddenForm(forms.Form): bar = forms.CharField(widget=forms.HiddenInput) class Medi...
{ "repo_name": "sinnwerkstatt/django-multiform", "path": "tests/forms.py", "copies": "3", "size": "2876", "license": "mit", "hash": 2519106557411842600, "line_mean": 20.4626865672, "line_max": 66, "alpha_frac": 0.6460361613, "autogenerated": false, "ratio": 3.9559834938101788, "config_test": fal...
from django import forms from multiupload.fields import MultiFileField from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, HTML, Submit, Fieldset from .models import Applicant, Attachment, Reference, Score, Note class ReferenceUpdateForm...
{ "repo_name": "ForumDev/djangocms-applicants", "path": "applicants/forms.py", "copies": "1", "size": "2048", "license": "mit", "hash": -4566669386909224400, "line_mean": 28.2714285714, "line_max": 90, "alpha_frac": 0.6235351562, "autogenerated": false, "ratio": 4.023575638506876, "config_test":...
from django import forms from nose.tools import eq_ from kuma.core.tests import KumaTestCase from . import user from ..adapters import (KumaAccountAdapter, USERNAME_CHARACTERS, USERNAME_EMAIL) from ..forms import UserEditForm class TestUserEditForm(KumaTestCase): def test_username(self...
{ "repo_name": "chirilo/kuma", "path": "kuma/users/tests/test_forms.py", "copies": "5", "size": "3468", "license": "mpl-2.0", "hash": 6461283722986512000, "line_mean": 32.6699029126, "line_max": 69, "alpha_frac": 0.5273933103, "autogenerated": false, "ratio": 4.213851761846902, "config_test": tr...
from django import forms from nose.tools import eq_, ok_ from kuma.core.tests import KumaTestCase from . import user from ..adapters import (KumaAccountAdapter, USERNAME_CHARACTERS, USERNAME_EMAIL) from ..forms import UserEditForm class TestUserEditForm(KumaTestCase): def test_username...
{ "repo_name": "darkwing/kuma", "path": "kuma/users/tests/test_forms.py", "copies": "12", "size": "4907", "license": "mpl-2.0", "hash": -257836666360547970, "line_mean": 33.5563380282, "line_max": 71, "alpha_frac": 0.5402486244, "autogenerated": false, "ratio": 4.028735632183908, "config_test": ...
from django import forms from noticeBoard.models import Notice class NoticeCreateForm(forms.ModelForm): title = forms.CharField(label='Title', help_text="Enter title", widget=forms.TextInput(attrs={'placeholder': "Title"})) message = forms.CharField(label="Message", help_text="En...
{ "repo_name": "Sparker0i/fosswebsite", "path": "noticeBoard/forms.py", "copies": "8", "size": "1131", "license": "mit", "hash": -5442490528288245000, "line_mean": 38, "line_max": 86, "alpha_frac": 0.5959328028, "autogenerated": false, "ratio": 4.435294117647059, "config_test": false, "has_no_...
from django import forms from olympia.translations.fields import TranslatedField from django.utils.functional import cached_property class AMOModelForm(forms.ModelForm): @cached_property def changed_data(self): """ The standard modelform thinks the Translation PKs are the initial val...
{ "repo_name": "bqbn/addons-server", "path": "src/olympia/amo/forms.py", "copies": "5", "size": "1282", "license": "bsd-3-clause", "hash": -5681457129055238000, "line_mean": 31.8717948718, "line_max": 74, "alpha_frac": 0.624024961, "autogenerated": false, "ratio": 4.661818181818182, "config_test...
from django import forms from orders.models import Address class CheckoutForm(forms.Form): # These fields correspond to the address model street = forms.CharField(max_length=60, initial='1234 First st') city = forms.CharField(max_length=60, initial='nowhere') state = forms.CharField(max_length=2,...
{ "repo_name": "giovannicode/djangoseller", "path": "checkout/forms.py", "copies": "1", "size": "1237", "license": "bsd-3-clause", "hash": -5581485612528892000, "line_mean": 36.4848484848, "line_max": 102, "alpha_frac": 0.6240905416, "autogenerated": false, "ratio": 3.889937106918239, "config_te...
from django import forms from oscar.apps.payment import forms as payment_forms from oscar.apps.order.models import BillingAddress class BillingAddressForm(payment_forms.BillingAddressForm): """ Extended version of the core billing address form that adds a field so customers can choose to re-use their shi...
{ "repo_name": "faratro/django-oscar", "path": "sites/demo/apps/checkout/forms.py", "copies": "33", "size": "2401", "license": "bsd-3-clause", "hash": 7598267666983002000, "line_mean": 40.3965517241, "line_max": 80, "alpha_frac": 0.6409829238, "autogenerated": false, "ratio": 4.02177554438861, "...
from django import forms from osm_field.widgets import OSMWidget from .models import ( ChildModel, CustomNamingModel, DefaultNamingModel, LocationWithDataModel, MixedNamingModel, MultipleNamingModel, ParentModel, ) class CustomNamingForm(forms.ModelForm): class Meta: fields =...
{ "repo_name": "MarkusH/django-osm-field", "path": "tests/forms.py", "copies": "1", "size": "2456", "license": "mit", "hash": 1928021255874398500, "line_mean": 20.7345132743, "line_max": 79, "alpha_frac": 0.5447882736, "autogenerated": false, "ratio": 4.433212996389892, "config_test": false, "...
from django import forms from ostinato.pages.models import Page class MovePageForm(forms.Form): node = forms.IntegerField() target = forms.IntegerField() position = forms.CharField() def clear_page_cache(self): Page.objects.clear_url_cache() Page.objects.clear_navbar_cache() ...
{ "repo_name": "andrewebdev/django-ostinato", "path": "ostinato/pages/forms.py", "copies": "1", "size": "1776", "license": "mit", "hash": 7141790098327663000, "line_mean": 27.6451612903, "line_max": 74, "alpha_frac": 0.5990990991, "autogenerated": false, "ratio": 3.8777292576419216, "config_test...
from django import forms from parcel.models import Client, Parcel, Location, Vehicle class ClientForm(forms.ModelForm): class Meta: model = Client exclude = [] class ParcelForm(forms.ModelForm): class Meta: model = Parcel exclude = ['status', 'sender', 'current_location', ...
{ "repo_name": "boyombo/django-stations", "path": "stations/parcel/forms.py", "copies": "1", "size": "1539", "license": "mit", "hash": -6666796472977575000, "line_mean": 29.1764705882, "line_max": 70, "alpha_frac": 0.6510721248, "autogenerated": false, "ratio": 4.182065217391305, "config_test": ...
from django import forms from parsr.models import Repo class RepoForm(forms.ModelForm): class Meta: model = Repo fields = ["url", "kind", "timezone", "ignored_folders", "ignored_files", "anonymous", "user", "password"] def get_widget(widget, optional=False, autocomplete=True): ...
{ "repo_name": "frontendphil/analyzr", "path": "parsr/forms.py", "copies": "1", "size": "1469", "license": "mit", "hash": 5732052347345206000, "line_mean": 26.7169811321, "line_max": 113, "alpha_frac": 0.522804629, "autogenerated": false, "ratio": 4.506134969325154, "config_test": false, "has_...
from django import forms from pastebin import settings from pastes.models import Paste from users.models import Limiter from humanfriendly import format_timespan import highlighting class SubmitPasteForm(forms.Form): """ Form to submit the paste Contains paste text, title and optionally, time until...
{ "repo_name": "Matoking/pastebin-django", "path": "pastes/forms.py", "copies": "1", "size": "5719", "license": "unlicense", "hash": -8071296693643049000, "line_mean": 35.9032258065, "line_max": 153, "alpha_frac": 0.5593635251, "autogenerated": false, "ratio": 4.4609984399375975, "config_test": ...
from django import forms from pinax.lms.activities.base import Survey class SuggestionBox(Survey): title = "Suggestion Box" description = "make a suggestion on how to improve the site" repeatable = True questions = [ { "name": "suggestion", "label": "Suggestion", ...
{ "repo_name": "jtauber/learning-greek", "path": "learning_greek/activities/surveys.py", "copies": "1", "size": "6814", "license": "mit", "hash": -4834257438855161000, "line_mean": 34.8631578947, "line_max": 205, "alpha_frac": 0.568682125, "autogenerated": false, "ratio": 4.046318289786223, "con...
from django import forms from posts.categoryModels import Category from .models import Post from pagedown.widgets import PagedownWidget class SearchForm(forms.Form): query = forms.CharField() class CategoryForm(forms.ModelForm): class Meta: model = Category fields = [ "parent", ...
{ "repo_name": "alien3211/lom-web", "path": "posts/forms.py", "copies": "1", "size": "1209", "license": "mit", "hash": 6977529412635944000, "line_mean": 25.8888888889, "line_max": 180, "alpha_frac": 0.6038047974, "autogenerated": false, "ratio": 3.99009900990099, "config_test": false, "has_no_...
from django import forms from pprint import pprint from witchform.cauldron import Cauldron, CauldronFormMixin from witchform.cauldron_toil import CauldronIngredient yes_no_choices = [ ('yes', 'Yes'), ('no', 'No'), ] class SkinType(forms.Form, CauldronFormMixin): copy = "Do ...
{ "repo_name": "caffeinate/witchform", "path": "pet_chooser/forms.py", "copies": "1", "size": "5654", "license": "apache-2.0", "hash": 8385680070109989000, "line_mean": 32.6547619048, "line_max": 112, "alpha_frac": 0.637424832, "autogenerated": false, "ratio": 3.3876572798082685, "config_test": ...
from django import forms from premis_event_service import settings OUTCOME_CHOICES = settings.EVENT_OUTCOME_CHOICES EVENT_TYPE_CHOICES = settings.EVENT_TYPE_CHOICES class EventSearchForm(forms.Form): event_outcome = forms.ChoiceField( widget=forms.Select(attrs={'id': 'prependedInput', 'class': 'input-sm...
{ "repo_name": "unt-libraries/django-premis-event-service", "path": "premis_event_service/forms.py", "copies": "1", "size": "1120", "license": "bsd-3-clause", "hash": -1557698564305694500, "line_mean": 35.1290322581, "line_max": 125, "alpha_frac": 0.6633928571, "autogenerated": false, "ratio": 3.7...
from django import forms from printer.fields import ( BergCloudTextField, BergCloudSelectField ) from printer.forms import ( BergCloudPublicationForm ) class HelloWorldPublicationForm(BergCloudPublicationForm): """ The Hello World example encapsulated in a django form """ meta = { ...
{ "repo_name": "jamescw/little_printer_django", "path": "django_printer/publication/forms.py", "copies": "1", "size": "2111", "license": "mit", "hash": 7193020913203762000, "line_mean": 30.5074626866, "line_max": 71, "alpha_frac": 0.5452392231, "autogenerated": false, "ratio": 3.776386404293381, ...
from django import forms from product.models import Sale, Payment, Rep, Invoice class SaleForm(forms.ModelForm): class Meta: model = Sale exclude = ['recorded_date', 'invoice', 'amount'] #def __init__(self, user, *args, **kwargs): # self.user = user # super(SaleForm, self).__in...
{ "repo_name": "boyombo/pharmrep", "path": "pharmrep/product/forms.py", "copies": "1", "size": "1259", "license": "mit", "hash": -8910294308557382000, "line_mean": 26.9777777778, "line_max": 68, "alpha_frac": 0.5949166005, "autogenerated": false, "ratio": 3.8384146341463414, "config_test": false...
from django import forms from profiles.models import SteamProfile, LeagueOfLegendsProfile, \ EveOnlineProfile, MinecraftProfile, NintendoProfile, PlaystationNetworkProfile, \ XboxLiveProfile, BattlefieldFourProfile, WorldOfTanksProfile class OAuthClientForm(forms.Form): callback_url = forms.URLField(hel...
{ "repo_name": "Ell/goonauth", "path": "profiles/forms.py", "copies": "1", "size": "1801", "license": "mit", "hash": 2475393978448481300, "line_mean": 28.0483870968, "line_max": 189, "alpha_frac": 0.7590227651, "autogenerated": false, "ratio": 4.10250569476082, "config_test": false, "has_no_ke...
from django import forms from public_interface.models import Genes from public_interface.models import GeneSets from public_interface.models import TaxonSets class BaseDatasetForm(forms.Form): """Base class for datasets. * Handles list of voucher codes including those from taxonsets. * Handles list of g...
{ "repo_name": "carlosp420/VoSeq", "path": "voseq/core/forms.py", "copies": "1", "size": "2221", "license": "bsd-3-clause", "hash": 9139484705722641000, "line_mean": 32.6515151515, "line_max": 78, "alpha_frac": 0.6235929761, "autogenerated": false, "ratio": 4.398019801980198, "config_test": fals...
from django import forms from pyston.filters.default_filters import ( DateFilter, ManyToManyFieldFilter, OPERATORS, ForeignKeyFilter, ForeignObjectRelFilter ) from is_core.forms.widgets import DateRangeFilterWidget, DateTimeRangeFilterWidget, RestrictedSelectWidget from . import UIFilterMixin, FilterChoiceIterat...
{ "repo_name": "matllubos/django-is-core", "path": "is_core/filters/default_filters.py", "copies": "1", "size": "3035", "license": "bsd-3-clause", "hash": -1412149481778707700, "line_mean": 33.8850574713, "line_max": 116, "alpha_frac": 0.7113673806, "autogenerated": false, "ratio": 4.8174603174603...
from django import forms from query_designer.models import Query def populate(mode): q = Query.objects.get(pk=2) q.document['limit'] = 500 results = q.execute()['results'] length = len(results) - 1 data = [] min = 9999 max = 0 if mode == 'ship': data.append(("all", "All Ships"...
{ "repo_name": "dipapaspyros/bdo_platform", "path": "visualizer/forms.py", "copies": "2", "size": "1808", "license": "mit", "hash": -4736990538179298000, "line_mean": 24.4647887324, "line_max": 92, "alpha_frac": 0.5022123894, "autogenerated": false, "ratio": 3.6747967479674797, "config_test": fa...
from django import forms from questionnaire.models import Questionnaire, Region from questionnaire.services.questionnaire_cloner import QuestionnaireClonerService from questionnaire.utils.form_utils import _set_year_choices class QuestionnaireFilterForm(forms.Form): questionnaire = forms.ModelChoiceField( ...
{ "repo_name": "eJRF/ejrf", "path": "questionnaire/forms/questionnaires.py", "copies": "1", "size": "3076", "license": "bsd-3-clause", "hash": -7474877931772544000, "line_mean": 47.078125, "line_max": 159, "alpha_frac": 0.6583224967, "autogenerated": false, "ratio": 4.042049934296978, "config_te...
from django import forms from rapidsms.router import lookup_connections class BaseHttpForm(forms.Form): """Helper form for validating incoming messages. :param backend_name: (Optional) name of the backend """ def __init__(self, *args, **kwargs): """Save backend name to form for use later"""...
{ "repo_name": "caktus/rapidsms", "path": "rapidsms/backends/http/forms.py", "copies": "7", "size": "1876", "license": "bsd-3-clause", "hash": 6591994300506421000, "line_mean": 33.7407407407, "line_max": 77, "alpha_frac": 0.6279317697, "autogenerated": false, "ratio": 4.32258064516129, "config_t...
from django import forms from readthedocs.builds.models import VersionAlias, Version from readthedocs.projects.models import Project from readthedocs.core.utils import trigger_build class AliasForm(forms.ModelForm): class Meta: model = VersionAlias fields = ( 'project', '...
{ "repo_name": "sunnyzwh/readthedocs.org", "path": "readthedocs/builds/forms.py", "copies": "29", "size": "1038", "license": "mit", "hash": 7547697497966976000, "line_mean": 28.6571428571, "line_max": 79, "alpha_frac": 0.5953757225, "autogenerated": false, "ratio": 4.236734693877551, "config_tes...
from django import forms from recipes.models import Recipe class RecipeForm(forms.models.ModelForm): class Meta: model = Recipe fields = ('title', 'ingredients', 'directions', 'servings', 'source', 'source_u...
{ "repo_name": "benosment/recipes", "path": "recipes/forms.py", "copies": "1", "size": "1641", "license": "mit", "hash": 320900856101942460, "line_mean": 31.1764705882, "line_max": 63, "alpha_frac": 0.4277879342, "autogenerated": false, "ratio": 4.688571428571429, "config_test": false, "has_no...
from django import forms from redeer.feeds.models import Group, Feed, Item def as_choices(iterable): return [(value, value) for value in iterable] # sadly, 'as' is a keyword, so we need this MarkFormBase = type('MarkFormBase', (forms.Form, ), { 'mark': forms.ChoiceField( choices=as_choices(['item', ...
{ "repo_name": "davidszotten/redeer", "path": "redeer/api/forms.py", "copies": "1", "size": "1435", "license": "mit", "hash": -1915328369737542000, "line_mean": 25.5740740741, "line_max": 69, "alpha_frac": 0.5581881533, "autogenerated": false, "ratio": 3.727272727272727, "config_test": false, ...
from django import forms from registration.backends.default import DefaultBackend from registration.forms import RegistrationForm,RegistrationFormUniqueEmail from django.db import transaction from opendata.models import ODPUserProfile from widgets import * from fields import * class ODPRegistrationForm(RegistrationFo...
{ "repo_name": "copelco/Durham-Open-Data-Catalog", "path": "OpenDataCatalog/registration_backend/__init__.py", "copies": "1", "size": "1662", "license": "mit", "hash": -8301744994186591000, "line_mean": 43.9189189189, "line_max": 141, "alpha_frac": 0.6877256318, "autogenerated": false, "ratio": 4....
from django import forms from registration.backends.default.views import RegistrationView # from registration.backends.default import DefaultBackend from registration.forms import RegistrationForm,RegistrationFormUniqueEmail from django.db import transaction from OpenDataCatalog.opendata.models import ODPUserProfile f...
{ "repo_name": "azavea/Open-Data-Catalog", "path": "OpenDataCatalog/registration_backend/__init__.py", "copies": "1", "size": "1822", "license": "mit", "hash": 1615539985845819400, "line_mean": 45.7179487179, "line_max": 141, "alpha_frac": 0.710208562, "autogenerated": false, "ratio": 4.2669789227...
from django import forms from repository.models import Repository, REPOSITORY_NAME_MAX_LENGTH, REPOSITORY_NAME_MIN_LENGTH, REPOSITORY_DESCRIPTION_MAX_LENGTH from utils.system import rename_tree from git.repo import Repo def name_length_validator(value): """ Validates given name in terms of length and uni...
{ "repo_name": "Djacket/djacket", "path": "core/backend/repository/forms.py", "copies": "1", "size": "5565", "license": "mit", "hash": 909450054815840800, "line_mean": 34.6730769231, "line_max": 131, "alpha_frac": 0.61868823, "autogenerated": false, "ratio": 4.310611928737413, "config_test": fal...
from django import forms from resources.models import Definition, help_category_choices class ResourceForm(forms.ModelForm): """Form for Resources""" class Meta(object): widgets = { 'resource_name': forms.Textarea(attrs={'rows': 1}), 'resource_website': forms.Textarea(attrs={'r...
{ "repo_name": "UPDDI/mps-database-server", "path": "resources/forms.py", "copies": "1", "size": "2984", "license": "mit", "hash": -1293842345632876800, "line_mean": 33.6976744186, "line_max": 105, "alpha_frac": 0.5707104558, "autogenerated": false, "ratio": 4.026990553306343, "config_test": fal...
from django import forms from rest_framework import serializers from rest_framework.exceptions import ParseError from lib.crypto.packaged import SigningError from mkt.api.exceptions import ServiceUnavailable from mkt.files.models import FileUpload from mkt.langpacks.models import LangPack class LangPackUploadSerial...
{ "repo_name": "diox/zamboni", "path": "mkt/langpacks/serializers.py", "copies": "6", "size": "2870", "license": "bsd-3-clause", "hash": -4293267807204537000, "line_mean": 35.3291139241, "line_max": 77, "alpha_frac": 0.6264808362, "autogenerated": false, "ratio": 4.5993589743589745, "config_test...
from django import forms from rest_framework import status from rest_framework.response import Response from tower import ugettext as _ from addons.models import Addon from api.jwt_auth.views import JWTProtectedView from devhub.views import handle_upload from files.models import FileUpload from files.utils import par...
{ "repo_name": "Witia1/olympia", "path": "apps/signing/views.py", "copies": "1", "size": "2848", "license": "bsd-3-clause", "hash": 7175526534209484000, "line_mean": 35.987012987, "line_max": 78, "alpha_frac": 0.6155196629, "autogenerated": false, "ratio": 4.463949843260188, "config_test": false...
from django import forms from russian_fields import validators class KPPField(forms.CharField): default_validators = [validators.kpp_validator] def clean(self, value): value = self.to_python(value).strip() return super(KPPField, self).clean(value) class INNField(forms.CharField): defaul...
{ "repo_name": "eternalfame/django-russian_fields", "path": "russian_fields/fields.py", "copies": "1", "size": "1250", "license": "mit", "hash": -6400790407999978000, "line_mean": 27.4318181818, "line_max": 72, "alpha_frac": 0.68, "autogenerated": false, "ratio": 3.7993920972644375, "config_test...
from django import forms from samples.models import SampleGroup class ContactForm1(forms.Form): subject = forms.CharField(max_length=100) sender = forms.EmailField() class ContactForm2(forms.Form): message = forms.CharField(widget=forms.Textarea) ANALYSIS_TYPES = ( ('qc', 'qc'), ('alignment', 'a...
{ "repo_name": "raonyguimaraes/mendelmd", "path": "analyses/forms.py", "copies": "1", "size": "1166", "license": "bsd-3-clause", "hash": -9065931915657822000, "line_mean": 27.4390243902, "line_max": 82, "alpha_frac": 0.6749571184, "autogenerated": false, "ratio": 3.7252396166134187, "config_test...
from django import forms from scores.models import Arrow, Score, Dozen class RetiringForm(forms.ModelForm): class Meta: model = Score fields = ['retired'] class ArrowForm(forms.ModelForm): arrow_value = forms.CharField(required=False) def clean(self): arrow_value = self.cleane...
{ "repo_name": "mjtamlyn/archery-scoring", "path": "scores/forms.py", "copies": "1", "size": "2912", "license": "bsd-3-clause", "hash": -5327545060130211000, "line_mean": 32.8604651163, "line_max": 109, "alpha_frac": 0.5934065934, "autogenerated": false, "ratio": 3.603960396039604, "config_test"...
from django import forms from select2rocks.widgets import AjaxSelect2Widget, Select2TextInput def label_from_instance_with_pk(obj, val): """Associates a label with the pk of the object that generated it. This is needed because we cannot rely on the order elements will appear in select2. By doing a bindi...
{ "repo_name": "Polyconseil/django-select2-rocks", "path": "select2rocks/fields.py", "copies": "1", "size": "3016", "license": "bsd-2-clause", "hash": -6147242800508147000, "line_mean": 39.2133333333, "line_max": 123, "alpha_frac": 0.6780503979, "autogenerated": false, "ratio": 3.984147952443857, ...
from django import forms from selectable.forms import fields from selectable.tests import ThingLookup from selectable.tests.base import BaseSelectableTestCase __all__ = ( 'AutoCompleteSelectFieldTestCase', 'AutoComboboxSelectFieldTestCase', 'AutoCompleteSelectMultipleFieldTestCase', 'AutoComboboxSele...
{ "repo_name": "MiltosD/CEFELRC", "path": "lib/python2.7/site-packages/selectable/tests/fields.py", "copies": "4", "size": "4027", "license": "bsd-3-clause", "hash": 2836196061854969000, "line_mean": 32.0081967213, "line_max": 100, "alpha_frac": 0.6674944127, "autogenerated": false, "ratio": 3.831...
from django import forms from .settings import PLAN_CHOICES from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Column, Div, Field, Fieldset, ButtonHolder, Submit class PlanForm(forms.Form): # pylint: disable=R0924 plan = forms.ChoiceField(choices=PLAN_CHOICES + [("", "------...
{ "repo_name": "ZeevG/django-stripe-payments", "path": "payments/forms.py", "copies": "1", "size": "1026", "license": "mit", "hash": -3303206960687944700, "line_mean": 30.0909090909, "line_max": 90, "alpha_frac": 0.5165692008, "autogenerated": false, "ratio": 4.137096774193548, "config_test": fa...
from django import forms from shoppy.contact.models import Contact from shoppy.l10n.models import DeliveryCountry class AddContactForm(forms.Form): lang = forms.CharField(max_length=2, required=True) title = forms.CharField(max_length=100, required=True) name = forms.CharField(max_length=200, required=Tru...
{ "repo_name": "pocketone/django-shoppy", "path": "shoppy/contact/forms.py", "copies": "1", "size": "1329", "license": "bsd-3-clause", "hash": 1732261395402462200, "line_mean": 38.0882352941, "line_max": 143, "alpha_frac": 0.6501128668, "autogenerated": false, "ratio": 3.5065963060686016, "confi...
from django import forms from shortener.baseconv import base62, DecodingError from shortener.models import Link too_long_error = "Your custom name is too long. Are you sure you wanted a shortening service? :)" class LinkSubmitForm(forms.Form): url = forms.URLField( label='URL to be shortened',) cus...
{ "repo_name": "yomr/django-url-shortener", "path": "shortener/forms.py", "copies": "2", "size": "1052", "license": "mit", "hash": 5587978451834548000, "line_mean": 29.9411764706, "line_max": 97, "alpha_frac": 0.6359315589, "autogenerated": false, "ratio": 4.401673640167364, "config_test": false...
from django import forms from simpleoncall.models import User class AuthenticationForm(forms.Form): username = forms.CharField( label='Email', max_length=100, required=True, widget=forms.TextInput(attrs={'placeholder': 'Email'}) ) password = forms.CharField( label='Password', requ...
{ "repo_name": "simpleoncall/simpleoncall", "path": "simpleoncall/forms/auth.py", "copies": "1", "size": "1078", "license": "mit", "hash": 3230526287280897500, "line_mean": 28.1351351351, "line_max": 69, "alpha_frac": 0.6372912801, "autogenerated": false, "ratio": 4.294820717131474, "config_test...
from django import forms from simpleoncall.models import User class EditAccountForm(forms.ModelForm): username = forms.EmailField( label='Email', max_length=100, required=True, widget=forms.TextInput(attrs={'placeholder': 'Email'}) ) first_name = forms.CharField( label='First Name...
{ "repo_name": "simpleoncall/simpleoncall", "path": "simpleoncall/forms/account.py", "copies": "1", "size": "1532", "license": "mit", "hash": -3163508628984016000, "line_mean": 29.0392156863, "line_max": 77, "alpha_frac": 0.6253263708, "autogenerated": false, "ratio": 4.107238605898123, "config_...
from django import forms from skills.skills.models import SkillTree, SkillTreeBranch, Skill, SkillLevel class CreateSkillTreeForm(forms.ModelForm): name = forms.CharField(required=True) class Meta: model = SkillTree exclude = ["owner"] class CreateSkillTreeBranchForm(forms.ModelForm): ...
{ "repo_name": "internetfett/skill-tree-builder", "path": "skills/skills/forms.py", "copies": "1", "size": "1381", "license": "mit", "hash": 4088857517081073000, "line_mean": 31.880952381, "line_max": 114, "alpha_frac": 0.7277335264, "autogenerated": false, "ratio": 3.8044077134986227, "config_t...
from django import forms from slackin.conf import settings from slackin.slack import Slack, SlackError class SlackinInviteForm(forms.Form): email_address = forms.EmailField(required=True) def clean_email_address(self): email_address = self.cleaned_data['email_address'] slack = Slack(token=s...
{ "repo_name": "brilliantorg/django-slackin", "path": "slackin/forms.py", "copies": "1", "size": "1268", "license": "mit", "hash": 2561958213207058400, "line_mean": 39.9032258065, "line_max": 102, "alpha_frac": 0.6238170347, "autogenerated": false, "ratio": 4.1035598705501615, "config_test": fal...
from django import forms from spark.questions.models import Answer, Question class QuestionForm(forms.ModelForm): title = forms.CharField( label='Título', widget=forms.TextInput(attrs={'class': 'form-control'}), max_length=255) description = forms.CharField( label='Descrição',...
{ "repo_name": "rg3915/spark", "path": "spark/questions/forms.py", "copies": "1", "size": "1192", "license": "mit", "hash": 4267361258659626500, "line_mean": 32, "line_max": 120, "alpha_frac": 0.6212121212, "autogenerated": false, "ratio": 4.125, "config_test": false, "has_no_keywords": false,...
from django import forms from standards.models import Subject, Cluster, Category, Subcategory, Grade, CommonCoreStandard class SearchForm(forms.Form): keyword = forms.CharField(required=False) standard = forms.ModelChoiceField(queryset=CommonCoreStandard.objects.all(), required=False, empty_la...
{ "repo_name": "katemsu/kate_website", "path": "kate3/standards/forms.py", "copies": "1", "size": "1568", "license": "mit", "hash": -3430508542845094000, "line_mean": 42.5833333333, "line_max": 95, "alpha_frac": 0.6843112245, "autogenerated": false, "ratio": 3.4461538461538463, "config_test": fa...
from django import forms from stats.models import Goal, PlayFor, Game, Team from django.db.models import Count, Q, F, Prefetch from django.forms.models import inlineformset_factory, BaseInlineFormSet from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Fieldset, Field, Div, HTML from cri...
{ "repo_name": "tammolaube/soccer-island", "path": "soccer_island/stats/forms.py", "copies": "1", "size": "5816", "license": "apache-2.0", "hash": -4446227710262783000, "line_mean": 33.8263473054, "line_max": 124, "alpha_frac": 0.4329436039, "autogenerated": false, "ratio": 4.7400162999185005, "...
from django import forms from students.models import Child_detail, Child_family_detail class Child_detailform(forms.ModelForm): """Upload files with this form""" dob = forms.DateField(widget=forms.DateInput(format = '%d/%m/%Y'), input_formats=('%d/%m/%Y',)) sibling_name = forms.CharField(max_length=50) ...
{ "repo_name": "tnemisteam/cdf-steps", "path": "students/forms.py", "copies": "1", "size": "1237", "license": "mit", "hash": -3864776331847924000, "line_mean": 46.6153846154, "line_max": 123, "alpha_frac": 0.6564268391, "autogenerated": false, "ratio": 3.681547619047619, "config_test": false, ...
from django import forms from sysrev.api import PubMed from sysrev.models import * from widgets import * class ProfileForm(forms.ModelForm): class Meta: model = User fields = ("email",) def clean_email(self): email = self.cleaned_data.get('email') if self.instance and self.i...
{ "repo_name": "iliawnek/SystematicReview", "path": "sysrev/forms.py", "copies": "1", "size": "3161", "license": "mit", "hash": -4169693817356902000, "line_mean": 36.1882352941, "line_max": 184, "alpha_frac": 0.5855741854, "autogenerated": false, "ratio": 4.2831978319783195, "config_test": false...
from django import forms from tablemanager.models import Publish from application.models import Application,Application_Layers from wmsmanager.models import WmsLayer from borg_utils.form_fields import GroupedModelChoiceField from borg_utils.resource_status import ResourceStatus class ApplicationForm(forms.ModelForm):...
{ "repo_name": "rockychen-dpaw/borgcollector", "path": "application/forms.py", "copies": "2", "size": "2071", "license": "bsd-3-clause", "hash": -1142359240329796700, "line_mean": 43.0638297872, "line_max": 233, "alpha_frac": 0.6929019797, "autogenerated": false, "ratio": 4.200811359026369, "con...
from django import forms from tablemanager.models import Workspace from livelayermanager.models import Datasource,Layer,SqlViewLayer from borg_utils.form_fields import GeoserverSettingForm,MetaTilingFactorField,GridSetField from borg_utils.form_fields import GroupedModelChoiceField,BorgSelect from borg_utils.forms imp...
{ "repo_name": "parksandwildlife/borgcollector", "path": "livelayermanager/forms.py", "copies": "2", "size": "5053", "license": "bsd-3-clause", "hash": 4793930772699786000, "line_mean": 40.081300813, "line_max": 191, "alpha_frac": 0.692657827, "autogenerated": false, "ratio": 3.759672619047619, ...
from django import forms from tablemanager.models import Workspace from wmsmanager.models import WmsServer,WmsLayer from borg_utils.form_fields import GeoserverSettingForm,MetaTilingFactorField,GridSetField from borg_utils.form_fields import GroupedModelChoiceField,BorgSelect class WmsServerForm(forms.ModelForm,Geose...
{ "repo_name": "parksandwildlife/borgcollector", "path": "wmsmanager/forms.py", "copies": "2", "size": "3801", "license": "bsd-3-clause", "hash": 219525359586682300, "line_mean": 40.7692307692, "line_max": 191, "alpha_frac": 0.6711391739, "autogenerated": false, "ratio": 3.8393939393939394, "con...
from django import forms from taggit.forms import TagWidget from .models import JobListing class JobListingForm(forms.ModelForm): class Meta(object): model = JobListing fields = ['title', 'description', 'skills', 'compensation', 'location', 'location_latitude', 'location_longit...
{ "repo_name": "jacobian-archive/djobs", "path": "jobs/forms.py", "copies": "1", "size": "1309", "license": "bsd-3-clause", "hash": -2067274376695495000, "line_mean": 47.4814814815, "line_max": 86, "alpha_frac": 0.6004583652, "autogenerated": false, "ratio": 4.116352201257862, "config_test": fal...
from django import forms from taggit.models import Tag from .models import Document, File, Image, Link, Video class BaseDocumentForm(forms.ModelForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if Tag.objects.count(): self.fields['tags'] = forms.ModelMulti...
{ "repo_name": "HMSBeagle1831/rapidscience", "path": "rlp/documents/forms.py", "copies": "1", "size": "1288", "license": "mit", "hash": -1312781363678341600, "line_mean": 22.8518518519, "line_max": 88, "alpha_frac": 0.5434782609, "autogenerated": false, "ratio": 4.209150326797386, "config_test":...
from django import forms from taggit.utils import parse_tags from .models import Artwork, Review class ReviewForm(forms.Form): review_id = forms.IntegerField( widget=forms.HiddenInput, required=False ) artwork_name = forms.CharField() artwork_kind = forms.ChoiceField(choices=Artwork....
{ "repo_name": "wlonk/are_there_spiders", "path": "are_there_spiders/phobias/forms.py", "copies": "1", "size": "2190", "license": "mit", "hash": 4441666505220648400, "line_mean": 33.21875, "line_max": 69, "alpha_frac": 0.6168949772, "autogenerated": false, "ratio": 3.9963503649635035, "config_te...
from django import forms from takeyourmeds.utils.twilio import validate_phone_number from ..apps import RemindersConfig from ..enums import TypeEnum from ..models import Reminder NUM_REMINDERS = 4 HOUR_MIN, HOUR_MAX = 5, 24 TIME_CHOICES = [(y, y) for y in [ '%02d:00' % (x % 24) for x in range(HOUR_MIN, HOUR_MAX...
{ "repo_name": "takeyourmeds/takeyourmeds-web", "path": "takeyourmeds/reminders/reminders_create/forms.py", "copies": "1", "size": "3031", "license": "mit", "hash": -7900528535863251000, "line_mean": 29.31, "line_max": 80, "alpha_frac": 0.5776971297, "autogenerated": false, "ratio": 3.798245614035...
from django import forms #from the models, we have this, (couchmodels.py) #flipping to tuple from django.forms import Form from corehq.apps.api.es import ReportCaseES from dimagi.utils.parsing import json_format_date from pact.enums import PACT_HP_CHOICES, PACT_DOT_CHOICES, PACT_REGIMEN_CHOICES, GENDER_CHOICES, PACT_R...
{ "repo_name": "qedsoftware/commcare-hq", "path": "custom/_legacy/pact/forms/patient_form.py", "copies": "1", "size": "5269", "license": "bsd-3-clause", "hash": 4476903777593646600, "line_mean": 45.6283185841, "line_max": 231, "alpha_frac": 0.641298159, "autogenerated": false, "ratio": 3.560135135...