bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def catalog_registered_classes_json(self, request, tl, one, two, module, extra, prog, timeslot=None): now = datetime.now() bits = UserBit.objects.filter(user=request.user, startdate__lte=now, enddate__gte=now).filter(QTree(verb__below=GetNode("V/Flags/Registration"), qsc__below=prog.anchor['Classes'])).distinct().selec... | def catalog_registered_classes_json(self, request, tl, one, two, module, extra, prog, timeslot=None): now = datetime.now() bits = UserBit.objects.filter(user=request.user, startdate__lte=now, enddate__gte=now).filter(QTree(verb__below=GetNode("V/Flags/Registration"), qsc__below=prog.anchor['Classes'])).distinct().selec... | 453,700 |
def catalog_registered_classes_json(self, request, tl, one, two, module, extra, prog, timeslot=None): now = datetime.now() bits = UserBit.objects.filter(user=request.user, startdate__lte=now, enddate__gte=now).filter(QTree(verb__below=GetNode("V/Flags/Registration"), qsc__below=prog.anchor['Classes'])).distinct().selec... | def catalog_registered_classes_json(self, request, tl, one, two, module, extra, prog, timeslot=None): now = datetime.now() bits = UserBit.objects.filter(user=request.user, startdate__lte=now, enddate__gte=now).filter(QTree(verb__below=GetNode("V/Flags/Registration"), qsc__below=prog.anchor['Classes'])).distinct().selec... | 453,701 |
def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None or get_user_django is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser from esp.utils.get_user import get_user | def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser from esp.utils.get_user import get_user | 453,702 |
def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None or get_user_django is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser from esp.utils.get_user import get_user | def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None or get_user_django is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser from esp.utils.get_user import get_user | 453,703 |
def add_section(self, duration=0.0, status=0): """ Add a ClassSection belonging to this class. Can be run multiple times. """ section_index = self.sections.count() + 1 new_section = ClassSection() new_section.parent_class = self new_section.duration = '%.4f' % duration new_section.anchor = DataTree.get_by_uri(self.an... | def add_section(self, duration=None, status=None): """ Add a ClassSection belonging to this class. Can be run multiple times. """ section_index = self.sections.count() + 1 new_section = ClassSection() new_section.parent_class = self new_section.duration = '%.4f' % duration new_section.anchor = DataTree.get_by_uri(sel... | 453,704 |
def testAcctCreate(self): self.u=User( first_name='bob', last_name='jones', username='bjones', email='test@bjones.com', # is_staff=True, ) self.u.set_password('123!@#') self.u.save() self.group=Group(name='Test Group') self.group.save() self.u.groups.add(self.group) self.assertEquals(User.objects.get(username='bjones')... | def testAcctCreate(self): self.u=User( first_name='bob', last_name='jones', username='bjones', email='test@bjones.com', # is_staff=True, ) self.u.set_password('123!@#') self.u.save() self.group=Group(name='Test Group') self.group.save() self.u.groups.add(self.group) self.assertEquals(User.objects.get(username='bjones')... | 453,705 |
def teacherreg(self): """ Test teacher registration (currently just class reg) through the web form. """ # Just register a class for now. # Make rooms & times, since I'm too lazy to do that as a test just yet. from esp.cal.models import EventType, Event from esp.resources.models import Resource, ResourceType, ResourceA... | def teacherreg(self): """ Test teacher registration (currently just class reg) through the web form. """ # Just register a class for now. # Make rooms & times, since I'm too lazy to do that as a test just yet. from esp.cal.models import EventType, Event from esp.resources.models import Resource, ResourceType, ResourceA... | 453,706 |
def user_has_TYPE(self, user, node, node_type='qsc'): """ Returns true if the user has the verb anywhere. False otherwise. """ node_id = getattr(node, 'id', node) col_filter = '%s__above' % node_type cache_key = 'has_%s__%s' % (node_type, node_id) | def user_has_TYPE(self, user, node, node_type='qsc'): """ Returns true if the user has the verb anywhere. False otherwise. """ node_id = getattr(node, 'id', node) col_filter = '%s__above' % node_type cache_key = 'has_%s__%s' % (node_type, node_id) | 453,707 |
def studentschedules(self, request, tl, one, two, module, extra, prog, onsite=False): """ generate student schedules """ context = {'module': self } | def studentschedules(self, request, tl, one, two, module, extra, prog, onsite=False): """ generate student schedules """ context = {'module': self } | 453,708 |
def makeaclass(self, request, tl, one, two, module, extra, prog, newclass = None): # this is ugly...but it won't recurse and falls # back to @meets_deadline's behavior appropriately if newclass is None and not self.deadline_met(): return meets_deadline(lambda: True)(self, request, tl, one, two, module) | def makeaclass(self, request, tl, one, two, module, extra, prog, newclass = None): # this is ugly...but it won't recurse and falls # back to @meets_deadline's behavior appropriately if newclass is None and not self.deadline_met(): return meets_deadline(lambda: True)(self, request, tl, one, two, module) | 453,709 |
def all_classes_spreadsheet(self, request, tl, one, two, module, extra, prog): import csv from django.http import HttpResponse from django.utils.encoding import smart_str | def all_classes_spreadsheet(self, request, tl, one, two, module, extra, prog): import csv from django.http import HttpResponse from django.utils.encoding import smart_str | 453,710 |
def all_classes_spreadsheet(self, request, tl, one, two, module, extra, prog): import csv from django.http import HttpResponse from django.utils.encoding import smart_str | def all_classes_spreadsheet(self, request, tl, one, two, module, extra, prog): import csv from django.http import HttpResponse from django.utils.encoding import smart_str | 453,711 |
def needs_resource(resname, section): if section.getResourceRequests().filter(res_type__name=resname): return 'Y' else: return ' ' | def needs_resource(resname, section): if section.getResourceRequests().filter(res_type__name=resname): return 'Y' else: return ' ' | 453,712 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,713 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,714 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,715 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,716 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,717 |
def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | def backwards(self, orm): # Deleting model 'StudentClassRegModuleInfo' db.delete_table('modules_studentclassregmoduleinfo') # Deleting model 'RemoteProfile' db.delete_table('modules_remoteprofile') # Deleting model 'ClassRegModuleInfo' db.delete_table('modules_classregmoduleinfo') # Deleting model 'SATPrepTeacherMo... | 453,718 |
def is_morphed(self, request): return 'user_morph' in request.session | def is_morphed(self, request=None): if not request: request = get_current_request() return 'user_morph' in request.session | 453,719 |
def get_old(self, request): if not self.is_morphed(): return False return ESPUser.objects.get(id=request.session['user_morph']['olduser_id']) | def get_old(self, request): if not self.is_morphed(request): return False return ESPUser.objects.get(id=request.session['user_morph']['olduser_id']) | 453,720 |
def allowed_sections_actual_get(self): if self.allowed_sections: return self.allowed_sections_ints_get() else: # Unfortunately, it turns out the ProgramModule system does obscene # things with __dict__, so the class specification up there is a # blatant lie. Why the designer didn't think of giving two # different field... | def allowed_sections_actual_get(self): if self.allowed_sections: return self.allowed_sections_ints_get() else: # Unfortunately, it turns out the ProgramModule system does obscene # things with __dict__, so the class specification up there is a # blatant lie. Why the designer didn't think of giving two # different field... | 453,721 |
def getClassGrades(self): min_grade, max_grade = (6, 12) if self.module.program.grade_min: min_grade = self.program.grade_min if self.module.program.grade_max: max_grade = self.program.grade_max | def getClassGrades(self): min_grade, max_grade = (6, 12) if self.module.program.grade_min: min_grade = self.program.grade_min if self.module.program.grade_max: max_grade = self.program.grade_max | 453,722 |
def getTimes(self): times = self.module.program.getTimeSlots() return [(str(x.id),x.short_description) for x in times] | def getTimes(self): times = self.get_program().getTimeSlots() return [(str(x.id),x.short_description) for x in times] | 453,723 |
def getDurations(self): return self.module.program.getDurations() | def getDurations(self): return self.module.program.getDurations() | 453,724 |
def getResources(self): resources = self.module.program.getResources() return [(str(x.id), x.name) for x in resources] | def getResources(self): resources = self.get_program().getResources() return [(str(x.id), x.name) for x in resources] | 453,725 |
def getResourceTypes(self, is_global=None): # Get a list of all resource types, excluding the fundamental ones. base_types = self.module.program.getResourceTypes().filter(priority_default__gt=0) if is_global is True: res_types = base_types.filter(program__isnull=True) elif is_global is False: res_types = base_types.... | def getResourceTypes(self, is_global=None): # Get a list of all resource types, excluding the fundamental ones. base_types = self.get_program().getResourceTypes().filter(priority_default__gt=0) if is_global is True: res_types = base_types.filter(program__isnull=True) elif is_global is False: res_types = base_types.f... | 453,726 |
def getUserTypes(self): """ Return the set of types for this user """ return UserBit.valid_objects().filter(user=self, verb__parent=GetNode("V/Flags/UserRole")).values_list('verb__name', flat=True).distinct() | def getUserTypes(self): """ Return the set of types for this user """ retVal = UserBit.valid_objects().filter(user=self, verb__parent=GetNode("V/Flags/UserRole")).values_list('verb__name', flat=True).distinct() if len(retVal) == 0: UserBit.objects.create(user=self, verb=GetNode("V/Flags/UserRole/Student"), qsc=GetNode(... | 453,727 |
def timeslot_ids(self): return self.meeting_times.all().values_list('id', flat=True) | def timeslot_ids(self): return self.meeting_times.all().values_list('id', flat=True) | 453,728 |
def timeslot_ids(self): return self.meeting_times.all().values_list('id', flat=True) | def timeslot_ids(self): return self.meeting_times.all().values_list('id', flat=True) | 453,729 |
def teachers(self, QObject = False): """ Returns a list of teachers who have indicated at least one segment of teaching availability for this program. """ if QObject is True: return {'availability': self.getQForUser(Q(resource__event__anchor = self.program_anchor_cached()))} teacher_list = Resource.objects.filter(eve... | def teachers(self, QObject = False): """ Returns a list of teachers who have indicated at least one segment of teaching availability for this program. """ if QObject is True: return {'availability': self.getQForUser(qf)} teacher_list = Resource.objects.filter(event__anchor=self.program_anchor_cached(), user__isnull=F... | 453,730 |
def teachers(self, QObject = False): """ Returns a list of teachers who have indicated at least one segment of teaching availability for this program. """ if QObject is True: return {'availability': self.getQForUser(Q(resource__event__anchor = self.program_anchor_cached()))} teacher_list = Resource.objects.filter(eve... | def teachers(self, QObject = False): """ Returns a list of teachers who have indicated at least one segment of teaching availability for this program. """ if QObject is True: return {'availability': self.getQForUser(Q(resource__event__anchor = self.program_anchor_cached()))} teacher_list = User.objects.filter(qf).dis... | 453,731 |
def process(self, user, class_id, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, user_type) else: self.process_nomailman(user, class_id, user_type) | def process(self, user, class_id, section_num, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, user_type) else: self.process_nomailman(user, class_id, user_type) | 453,732 |
def process(self, user, class_id, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, user_type) else: self.process_nomailman(user, class_id, user_type) | def process(self, user, class_id, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, section_num, user_type) else: self.process_nomailman(user, class_id, user_type) | 453,733 |
def process(self, user, class_id, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, user_type) else: self.process_nomailman(user, class_id, user_type) | def process(self, user, class_id, user_type): if USE_MAILMAN: self.process_mailman(user, class_id, user_type) else: self.process_nomailman(user, class_id, user_type) | 453,734 |
def recoverPassword(self): # generate the ticket, send the email. from django.contrib.sites.models import Site from django.conf import settings | def recoverPassword(self): # generate the ticket, send the email. from django.contrib.sites.models import Site from django.conf import settings | 453,735 |
def get_section(self, timeslot=None): """ Cache sections for a class. Always use this function to get a class's sections. """ | def get_section(self, timeslot=None): """ Cache sections for a class. Always use this function to get a class's sections. """ | 453,736 |
def get_section(self, timeslot=None): """ Cache sections for a class. Always use this function to get a class's sections. """ | def get_section(self, timeslot=None): """ Cache sections for a class. Always use this function to get a class's sections. """ | 453,737 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,738 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,739 |
def force_availability(self, request, tl, one, two, module, extra, prog): teacher_dict = prog.teachers() if request.method == 'POST': if request.POST.has_key('sure') and request.POST['sure'] == 'True': # Find all teachers who have not indicated their availability and do it for them. unavailable_teachers = User.obje... | def force_availability(self, request, tl, one, two, module, extra, prog): teacher_dict = prog.teachers() if request.method == 'POST': if request.POST.has_key('sure') and request.POST['sure'] == 'True': # Find all teachers who have not indicated their availability and do it for them. unavailable_teachers = User.obje... | 453,740 |
def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | 453,741 |
def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | 453,742 |
def __init__(self, newclslist): self.clslist = newclslist | def __init__(self, newclslist): self.clslist = newclslist | 453,743 |
def clean_phone_cell(self): if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', False) and self.cleaned_data.get('phone_cell','') == '': raise form... | def clean(self): if Tag.getTag('request_student_phonenum', default='True') != 'False': if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', False) a... | 453,744 |
def clean_phone_cell(self): if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', False) and self.cleaned_data.get('phone_cell','') == '': raise form... | def clean_phone_cell(self): if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', False) and self.cleaned_data.get('phone_cell','') == '': raise form... | 453,745 |
def clean_emerg_phone_cell(self): if self.cleaned_data.get('emerg_phone_day','') == '' and self.cleaned_data.get('emerg_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['emerg_phone_cell'] | def clean(self): if self.cleaned_data.get('emerg_phone_day','') == '' and self.cleaned_data.get('emerg_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['emerg_phone_cell'] | 453,746 |
def clean_emerg_phone_cell(self): if self.cleaned_data.get('emerg_phone_day','') == '' and self.cleaned_data.get('emerg_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['emerg_phone_cell'] | def clean_emerg_phone_cell(self): if self.cleaned_data.get('emerg_phone_day','') == '' and self.cleaned_data.get('emerg_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['emerg_phone_cell'] | 453,747 |
def clean_guard_phone_cell(self): if self.cleaned_data.get('guard_phone_day','') == '' and self.cleaned_data.get('guard_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['guard_phone_cell'] | def clean(self): if self.cleaned_data.get('guard_phone_day','') == '' and self.cleaned_data.get('guard_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['guard_phone_cell'] | 453,748 |
def clean_guard_phone_cell(self): if self.cleaned_data.get('guard_phone_day','') == '' and self.cleaned_data.get('guard_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['guard_phone_cell'] | def clean_guard_phone_cell(self): if self.cleaned_data.get('guard_phone_day','') == '' and self.cleaned_data.get('guard_phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") return self.cleaned_data['guard_phone_cell'] | 453,749 |
def __init__(self, user=None, *args, **kwargs): super(StudentInfoForm, self).__init__(user, *args, **kwargs) | def__init__(self,user=None,*args,**kwargs):super(StudentInfoForm,self).__init__(user,*args,**kwargs) | 453,750 |
def repress_studentrep_expl_error(self): self.studentrep_error = False | def repress_studentrep_expl_error(self): self.studentrep_error = False | 453,751 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | defuser_title = "Student" generatetags(self,user_title = "Student" request,user_title = "Student" tl,user_title = "Student" one,user_title = "Student" two,user_title = "Student" module,user_title = "Student" extra,user_title = "Student" prog):user_title = "Student" """user_title = "Student" generateuser_title = "Studen... | 453,752 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,753 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,754 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,755 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,756 |
def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | def generatetags(self, request, tl, one, two, module, extra, prog): """ generate nametags """ | 453,757 |
def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | def catalog_cached(self, program, ts=None, force_all=False, initial_queryset=None): """ Return a queryset of classes for view in the catalog. | 453,758 |
def prefetch_catalog_data(cls, queryset): """ Take a queryset of a set of ClassSubject's, and annotate each class in it with the '_count_students' and 'event_ids' fields (used internally when available by many functions to save on queries later) """ now = datetime.datetime.now() enrolled_node=GetNode("V/Flags/Registrat... | def prefetch_catalog_data(cls, queryset): """ Take a queryset of a set of ClassSubject's, and annotate each class in it with the '_count_students' and 'event_ids' fields (used internally when available by many functions to save on queries later) """ now = datetime.datetime.now() enrolled_node=GetNode("V/Flags/Registrat... | 453,759 |
def generate_director_mail_context(self, cls, user): new_data = cls.__dict__ print new_data; mail_ctxt = dict(new_data.iteritems()) print mail_ctxt; | def generate_director_mail_context(self, cls, user): new_data = cls.__dict__ print new_data; mail_ctxt = dict(new_data.iteritems()) print mail_ctxt; | 453,760 |
def import_resource_formset(self, sec, resform): if isinstance(resform.cleaned_data['desired_value'], list): for val in resform.cleaned_data['desired_value']: rr = ResourceRequest() rr.target = sec rr.res_type = resform.cleaned_data['resource_type'] rr.desired_value = val rr.save() else: rr = ResourceRequest() rr.targe... | def import_resource_formset(self, sec, resform): if isinstance(resform.cleaned_data['desired_value'], list): for val in resform.cleaned_data['desired_value']: rr = ResourceRequest() rr.target = sec rr.res_type = resform.cleaned_data['resource_type'] rr.desired_value = val rr.save() else: rr = ResourceRequest() rr.targe... | 453,761 |
def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent(): return 'You are not a student!' if not self.isAccepted(): return 'This class is not accepted.' | def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent(): return 'You are not a student!' if not self.isAccepted(): return 'This class is not accepted.' | 453,762 |
def _checkTeacher(moduleObj, request, *args, **kwargs): allowed_teacher_types = Tag.getTag("allowed_teacher_types", moduleObj.program, default='').split(",") if not moduleObj.user or not moduleObj.user.is_authenticated(): return HttpResponseRedirect('%s?%s=%s' % (LOGIN_URL, REDIRECT_FIELD_NAME, quote(request.get_full_p... | def _checkTeacher(moduleObj, request, *args, **kwargs): allowed_teacher_types = Tag.getTag("allowed_teacher_types", moduleObj.program, default='').split(",") if not moduleObj.user or not moduleObj.user.is_authenticated(): return HttpResponseRedirect('%s?%s=%s' % (LOGIN_URL, REDIRECT_FIELD_NAME, quote(request.get_full_p... | 453,763 |
def getLists(self, QObjects=False): from esp.users.models import ESPUser lists = self.students(QObjects) lists.update(self.teachers(QObjects)) learnmodules = self.getModules(None) teachmodules = self.getModules(None) | def getLists(self, QObjects=False): from esp.users.models import ESPUser lists = self.students(QObjects) lists.update(self.teachers(QObjects)) learnmodules = self.getModules(None) teachmodules = self.getModules(None) | 453,764 |
def getLists(self, QObjects=False): from esp.users.models import ESPUser lists = self.students(QObjects) lists.update(self.teachers(QObjects)) learnmodules = self.getModules(None) teachmodules = self.getModules(None) | def getLists(self, QObjects=False): from esp.users.models import ESPUser lists = self.students(QObjects) lists.update(self.teachers(QObjects)) learnmodules = self.getModules(None) teachmodules = self.getModules(None) | 453,765 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: sys.stdout.write("true") sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | 453,766 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: sys.stdout.write("false") sys.exit(1) else: print val sys.exit(255) | 453,767 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: sys.stdout.write(val) sys.exit(255) | 453,768 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | 453,769 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | 453,770 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | 453,771 |
def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | def return_(val): """ Return the specified return value in the appropriate format """ if val == True: print "true" sys.exit(0) elif val == False: print "false" sys.exit(1) else: print val sys.exit(255) | 453,772 |
def getAppliedClasses(self, program=None): # If priority registration is enabled, add in more verbs. if program: scrmi = program.getModuleExtension('StudentClassRegModuleInfo') verb_list = scrmi.reg_verbs(uris=True) else: verb_list = ['Applied'] return self.getClasses(program, verbs=verb_list) | def getAppliedClasses(self, program=None): # If priority registration is enabled, add in more verbs. if program: scrmi = program.getModuleExtension('StudentClassRegModuleInfo') verb_list = [v.name for v in scrmi.reg_verbs()] else: verb_list = ['Applied'] return self.getClasses(program, verbs=verb_list) | 453,773 |
def forwards(self, orm): # Adding model 'AdLogEntry' db.create_table('shortterm_adlogentry', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('ts', self.gf('django.db.models.fields.DateTimeField')()), ('ipaddr', self.gf('django.db.models.fields.CharField')(max_length=32)), ('agent', self.gf('... | def forwards(self, orm): # Adding model 'AdLogEntry' db.create_table('shortterm_adlogentry', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('ts', self.gf('django.db.models.fields.DateTimeField')()), ('ipaddr', self.gf('django.db.models.fields.CharField')(max_length=32)), ('agent', self.gf('... | 453,774 |
def backwards(self, orm): # Deleting model 'AdLogEntry' db.delete_table('shortterm_adlogentry') | def backwards(self, orm): # Deleting model 'AdLogEntry' db.delete_table('shortterm_adlogentry') | 453,775 |
def backwards(self, orm): # Deleting model 'AdLogEntry' db.delete_table('shortterm_adlogentry') | def backwards(self, orm): # Deleting model 'AdLogEntry' db.delete_table('shortterm_adlogentry') | 453,776 |
def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser | def __get__(self, request, obj_type=None): global get_user_django, ESPUser if not hasattr(request, '_cached_user'): if get_user is None or ESPUser is None or get_user_django is None: from django.contrib.auth import get_user as get_user_django from esp.users.models import ESPUser | 453,777 |
def user_registration(request): """ Registration view -- takes care of users who want to create a new account. """ if request.user.is_authenticated(): return render_to_response('registration/already_logged_in.html', request, request.get_node('Q/Web/myesp'), {}) if request.method == 'POST': form = UserRegForm(request.... | def user_registration(request): """ Registration view -- takes care of users who want to create a new account. """ if request.user.is_authenticated(): return render_to_response('registration/already_logged_in.html', request, request.get_node('Q/Web/myesp'), {}) if request.method == 'POST': form = UserRegForm(request.... | 453,778 |
def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent(): return 'You are not a student!' if not self.isAccepted(): return 'This class is not accepted.' | def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent(): return 'You are not a student!' if not self.isAccepted(): return 'This class is not accepted.' | 453,779 |
def forwards(self, orm): # Adding model 'StudentRegistration' db.create_table('program_studentregistration', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('section', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['program.ClassSection'])), ('user', self.gf('django.db.models.f... | def forwards(self, orm): # Adding model 'StudentRegistration' db.create_table('program_studentregistration', ( ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), ('section', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['program.ClassSection'])), ('user', self.gf('django.db.models.f... | 453,780 |
def _get_capacity(self, ignore_changes=False): ans = None if self.max_class_capacity is not None: ans = self.max_class_capacity | def _get_capacity(self, ignore_changes=False): ans = None if self.max_class_capacity is not None: ans = self.max_class_capacity | 453,781 |
def gen_latex(texcode, type='pdf', landscape=False): """ Generate the latex code. """ remove_files = True file_base = os.path.join(TEX_TEMP, get_rand_file_base()) if type == 'tex': return HttpResponse(texcode, mimetype='text/plain') # write to the LaTeX file texfile = open(file_base+TEX_EXT, 'w') texfile.write(te... | def gen_latex(texcode, type='pdf', landscape=False): """ Generate the latex code. """ remove_files = True file_base = os.path.join(TEX_TEMP, get_rand_file_base()) if type == 'tex': return HttpResponse(texcode, mimetype='text/plain') # write to the LaTeX file texfile = open(file_base+TEX_EXT, 'w') texfile.write(te... | 453,782 |
def gen_latex(texcode, type='pdf', landscape=False): """ Generate the latex code. """ remove_files = True file_base = os.path.join(TEX_TEMP, get_rand_file_base()) if type == 'tex': return HttpResponse(texcode, mimetype='text/plain') # write to the LaTeX file texfile = open(file_base+TEX_EXT, 'w') texfile.write(te... | def gen_latex(texcode, type='pdf', landscape=False): """ Generate the latex code. """ remove_files = True file_base = os.path.join(TEX_TEMP, get_rand_file_base()) if type == 'tex': return HttpResponse(texcode, mimetype='text/plain') # write to the LaTeX file texfile = open(file_base+TEX_EXT, 'w') texfile.write(te... | 453,783 |
def force_availability(self, request, tl, one, two, module, extra, prog): teacher_dict = prog.teachers() if request.method == 'POST': if request.POST.has_key('sure') and request.POST['sure'] == 'True': # Find all teachers who have not indicated their availability and do it for them. unavailable_teachers = User.obje... | def force_availability(self, request, tl, one, two, module, extra, prog): teacher_dict = prog.teachers() if request.method == 'POST': if request.POST.has_key('sure') and request.POST['sure'] == 'True': # Find all teachers who have not indicated their availability and do it for them. unavailable_teachers = User.obje... | 453,784 |
def prefetch_catalog_data(cls, queryset): """ Take a queryset of a set of ClassSubject's, and annotate each class in it with the '_count_students' and 'event_ids' fields (used internally when available by many functions to save on queries later) """ now = datetime.datetime.now() enrolled_node=GetNode("V/Flags/Registrat... | def prefetch_catalog_data(cls, queryset): """ Take a queryset of a set of ClassSubject's, and annotate each class in it with the '_count_students' and 'event_ids' fields (used internally when available by many functions to save on queries later) """ now = datetime.datetime.now() enrolled_node=GetNode("V/Flags/Registrat... | 453,785 |
def studentschedule(self, request, *args, **kwargs): # tl, one, two, module, extra, prog format = 'pdf' if 'format' in request.GET: format = request.GET['format'].lower() request.GET = {'op':'usersearch', 'userid': str(self.user.id) } | def studentschedule(self, request, *args, **kwargs): # tl, one, two, module, extra, prog format = 'pdf' if 'format' in request.GET: format = request.GET['format'].lower() request.GET = {'op':'usersearch', 'userid': str(self.user.id) } | 453,786 |
def clean_phone_cell(self): if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', False) and self.cleaned_data.get('phone_cell','') == '': raise form... | def clean_phone_cell(self): if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_data.get('receive_txt_message', '') == '' and self.cleaned_data.get('phone_cell','') == '': raise f... | 453,787 |
def load_classroom(self, program, room): self.fields['id'].initial = room.id self.fields['room_number'].initial = room.name self.fields['num_students'].initial = room.num_students self.fields['times_available'].initial = [mt.short_description for mt in room.matching_times()] self.fields['furnishings'].initial = [f.res_... | def load_classroom(self, program, room): self.fields['id'].initial = room.id self.fields['room_number'].initial = room.name self.fields['num_students'].initial = room.num_students self.fields['times_available'].initial = [mt.id for mt in room.matching_times()] self.fields['furnishings'].initial = [f.res_type.id for f i... | 453,788 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,789 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,790 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,791 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,792 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,793 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,794 |
def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | def save_classroom(self, program): """ Steps for saving a classroom: - Find the previous list of resources - Create a new list of resources - Move over resource assignments - Delete old resources """ | 453,795 |
def clean(self): super(UserContactForm, self).clean() if Tag.getTag('request_student_phonenum', default='True') != 'False': if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_dat... | def clean(self): super(UserContactForm, self).clean() if Tag.getTag('request_student_phonenum', default='True') != 'False': if self.cleaned_data.get('phone_day','') == '' and self.cleaned_data.get('phone_cell','') == '': raise forms.ValidationError("Please provide either a day phone or cell phone.") if self.cleaned_dat... | 453,796 |
def students_union(self, QObject = False): import operator if len(self.students().values()) == 0: if QObject: return Q(id = -1) else: return User.objects.filter(id = -1) union = reduce(operator.or_, [x for x in self.students(True).values() ]) if QObject: return union else: return User.objects.filter(union).distinct() | def students_union(self, QObject = False): import operator if len(self.students().values()) == 0: if QObject: return Q(id = -1) else: return ESPUser.objects.filter(id = -1) union = reduce(operator.or_, [x for x in self.students(True).values() ]) if QObject: return union else: return User.objects.filter(union).distinct... | 453,797 |
def students_union(self, QObject = False): import operator if len(self.students().values()) == 0: if QObject: return Q(id = -1) else: return User.objects.filter(id = -1) union = reduce(operator.or_, [x for x in self.students(True).values() ]) if QObject: return union else: return User.objects.filter(union).distinct() | def students_union(self, QObject = False): import operator if len(self.students().values()) == 0: if QObject: return Q(id = -1) else: return User.objects.filter(id = -1) union = reduce(operator.or_, [x for x in self.students(True).values() ]) if QObject: return union else: return User.objects.filter(union).distinct() | 453,798 |
def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent() and not Tag.getTag("allowed_student_types", target=self.parent_program): return 'You are not a student!' if not self.isAcc... | def cannotAdd(self, user, checkFull=True, request=False, use_cache=True): """ Go through and give an error message if this user cannot add this class to their schedule. """ if not user.isStudent() and not Tag.getTag("allowed_student_types", target=self.parent_program): return 'You are not a student!' if not self.isAcc... | 453,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.