diff --git a/common/djangoapps/config_models/models.py b/common/djangoapps/config_models/models.py index b042b42b7a5f43dccf5ed1fdcf936d993d7d77fa..415775e5354615fd5f68fe30a19996b2a89ffb4c 100644 --- a/common/djangoapps/config_models/models.py +++ b/common/djangoapps/config_models/models.py @@ -67,7 +67,7 @@ class ConfigurationModel(models.Model): should be cached """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): abstract = True ordering = ("-change_date", ) diff --git a/common/djangoapps/course_modes/admin.py b/common/djangoapps/course_modes/admin.py index cbf272bbd03c13fa2bf3634acbbf63e3c4fb95cf..f6c22551cd4c3bf09ebb6714cb4c3b29d13c6329 100644 --- a/common/djangoapps/course_modes/admin.py +++ b/common/djangoapps/course_modes/admin.py @@ -31,7 +31,7 @@ from verify_student import models as verification_models # pylint: disable=impo class CourseModeForm(forms.ModelForm): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseMode COURSE_MODE_SLUG_CHOICES = ( diff --git a/common/djangoapps/course_modes/models.py b/common/djangoapps/course_modes/models.py index ccff710372f0c282d00c981dac013b4c0195fee0..293f9715fd9fb1b70283d5125ca030e740f9035e 100644 --- a/common/djangoapps/course_modes/models.py +++ b/common/djangoapps/course_modes/models.py @@ -110,7 +110,6 @@ class CourseMode(models.Model): UPSELL_TO_VERIFIED_MODES = [HONOR] class Meta(object): - """ meta attributes of this model """ unique_together = ('course_id', 'mode_slug', 'currency') def clean(self): diff --git a/common/djangoapps/django_comment_common/models.py b/common/djangoapps/django_comment_common/models.py index 6e739fc23507ed239e8d941b6ed8356db42d41b1..17c518d53e4cc9bb0e6e87f419317f3054ef3048 100644 --- a/common/djangoapps/django_comment_common/models.py +++ b/common/djangoapps/django_comment_common/models.py @@ -57,7 +57,7 @@ class Role(models.Model): users = models.ManyToManyField(User, related_name="roles") course_id = CourseKeyField(max_length=255, blank=True, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): # use existing table that was originally created from django_comment_client app db_table = 'django_comment_client_role' @@ -99,7 +99,7 @@ class Permission(models.Model): name = models.CharField(max_length=30, null=False, blank=False, primary_key=True) roles = models.ManyToManyField(Role, related_name="permissions") - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): # use existing table that was originally created from django_comment_client app db_table = 'django_comment_client_permission' diff --git a/common/djangoapps/embargo/forms.py b/common/djangoapps/embargo/forms.py index 2f29a664d0067060bab1b87a4258609866d50bb4..96f1b0c2ad977b4a542eda7eb8ea31c6849fb943 100644 --- a/common/djangoapps/embargo/forms.py +++ b/common/djangoapps/embargo/forms.py @@ -25,7 +25,7 @@ class RestrictedCourseForm(forms.ModelForm): error message instead. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = RestrictedCourse def clean_course_key(self): @@ -58,7 +58,7 @@ class RestrictedCourseForm(forms.ModelForm): class IPFilterForm(forms.ModelForm): """Form validating entry of IP addresses""" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = IPFilter def _is_valid_ip(self, address): diff --git a/common/djangoapps/embargo/models.py b/common/djangoapps/embargo/models.py index b51aae7866543a277680653db1bb30fb6f2dffbc..3598bb349d2313dca61f67fb4855688606074b14 100644 --- a/common/djangoapps/embargo/models.py +++ b/common/djangoapps/embargo/models.py @@ -646,7 +646,7 @@ class CourseAccessRuleHistory(models.Model): else: CourseAccessRuleHistory.save_snapshot(restricted_course) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = 'timestamp' diff --git a/common/djangoapps/enrollment/serializers.py b/common/djangoapps/enrollment/serializers.py index 994f97e5fc414cc0e825c4e5a70936fe478e5c5b..0047a069fa396bb2db84d2658de17486222d7347 100644 --- a/common/djangoapps/enrollment/serializers.py +++ b/common/djangoapps/enrollment/serializers.py @@ -76,7 +76,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer): """Retrieves the username from the associated model.""" return model.username - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseEnrollment fields = ('created', 'mode', 'is_active', 'course_details', 'user') lookup_field = 'username' diff --git a/common/djangoapps/external_auth/models.py b/common/djangoapps/external_auth/models.py index 180f28bae13c9afea2c364c6458e9c59f582ac37..65150dea9dd6b5f7a85445176e2a31a1430e7a37 100644 --- a/common/djangoapps/external_auth/models.py +++ b/common/djangoapps/external_auth/models.py @@ -14,8 +14,9 @@ from django.contrib.auth.models import User class ExternalAuthMap(models.Model): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('external_id', 'external_domain'), ) + external_id = models.CharField(max_length=255, db_index=True) external_domain = models.CharField(max_length=255, db_index=True) external_credentials = models.TextField(blank=True) # JSON dictionary diff --git a/common/djangoapps/student/admin.py b/common/djangoapps/student/admin.py index 4fae854e42fdfb43ac54da31541e030e9644ba7d..fef137969ef5d8b654ee81bc6a4b3f4a18a333ee 100644 --- a/common/djangoapps/student/admin.py +++ b/common/djangoapps/student/admin.py @@ -17,7 +17,7 @@ from student.roles import REGISTERED_ACCESS_ROLES class CourseAccessRoleForm(forms.ModelForm): """Form for adding new Course Access Roles view the Django Admin Panel.""" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseAccessRole email = forms.EmailField(required=True) @@ -125,7 +125,7 @@ class CourseAccessRoleAdmin(admin.ModelAdmin): class LinkedInAddToProfileConfigurationAdmin(admin.ModelAdmin): """Admin interface for the LinkedIn Add to Profile configuration. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = LinkedInAddToProfileConfiguration # Exclude deprecated fields @@ -144,7 +144,7 @@ class CourseEnrollmentAdmin(admin.ModelAdmin): return self.readonly_fields + ('course_id', 'mode', 'user',) return self.readonly_fields - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseEnrollment @@ -159,7 +159,7 @@ class UserProfileAdmin(admin.ModelAdmin): return self.readonly_fields + ('user',) return self.readonly_fields - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = UserProfile diff --git a/common/djangoapps/student/models.py b/common/djangoapps/student/models.py index e64fce3df287f643419d96a2a6591f5fc3ffb8a6..d573220dc077f4b57577e98268ca9b6e2002a2f7 100644 --- a/common/djangoapps/student/models.py +++ b/common/djangoapps/student/models.py @@ -216,7 +216,7 @@ class UserProfile(models.Model): # cache key format e.g user.<user_id>.profile.country = 'SG' PROFILE_COUNTRY_CACHE_KEY = u"user.{user_id}.profile.country" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): db_table = "auth_userprofile" # CRITICAL TODO/SECURITY @@ -487,7 +487,8 @@ class Registration(models.Model): registration profile is created when the user creates an account, but that account is inactive. Once the user clicks on the activation key, it becomes active. ''' - class Meta(object): # pylint: disable=missing-docstring + + class Meta(object): db_table = "auth_registration" user = models.ForeignKey(User, unique=True) @@ -903,7 +904,7 @@ class CourseEnrollment(models.Model): # cache key format e.g enrollment.<username>.<course_key>.mode = 'honor' COURSE_ENROLLMENT_CACHE_KEY = u"enrollment.{}.{}.mode" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('user', 'course_id'),) ordering = ('user', 'course_id') @@ -1516,7 +1517,7 @@ class CourseEnrollmentAllowed(models.Model): created = models.DateTimeField(auto_now_add=True, null=True, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('email', 'course_id'),) def __unicode__(self): @@ -1553,7 +1554,7 @@ class CourseAccessRole(models.Model): course_id = CourseKeyField(max_length=255, db_index=True, blank=True) role = models.CharField(max_length=64, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ('user', 'org', 'course_id', 'role') @property @@ -1882,9 +1883,6 @@ class EntranceExamConfiguration(models.Model): skip_entrance_exam = models.BooleanField(default=True) class Meta(object): - """ - Meta class to make user and course_id unique in the table - """ unique_together = (('user', 'course_id'), ) def __unicode__(self): @@ -1944,7 +1942,7 @@ class LanguageProficiency(models.Model): /edx-platform/openedx/core/djangoapps/user_api/accounts/views.py or its associated api method (update_account_settings) so that the events are emitted. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('code', 'user_profile'),) user_profile = models.ForeignKey(UserProfile, db_index=True, related_name='language_proficiencies') diff --git a/common/djangoapps/third_party_auth/models.py b/common/djangoapps/third_party_auth/models.py index c732a9170a0f3f5a81abd2a55503782ba719e10d..53da94e116ad0e3a0781c4109c9a625b7be22881 100644 --- a/common/djangoapps/third_party_auth/models.py +++ b/common/djangoapps/third_party_auth/models.py @@ -104,7 +104,7 @@ class ProviderConfig(ConfigurationModel): # "enabled" field is inherited from ConfigurationModel - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): abstract = True @property @@ -203,7 +203,7 @@ class OAuth2ProviderConfig(ProviderConfig): ) other_settings = models.TextField(blank=True, help_text="Optional JSON object with advanced settings, if any.") - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): verbose_name = "Provider Configuration (OAuth)" verbose_name_plural = verbose_name @@ -282,7 +282,7 @@ class SAMLProviderConfig(ProviderConfig): super(SAMLProviderConfig, self).clean() self.other_settings = clean_json(self.other_settings, dict) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): verbose_name = "Provider Configuration (SAML IdP)" verbose_name_plural = "Provider Configuration (SAML IdPs)" @@ -373,7 +373,7 @@ class SAMLConfiguration(ConfigurationModel): ), ) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): verbose_name = "SAML Configuration" verbose_name_plural = verbose_name @@ -439,7 +439,7 @@ class SAMLProviderData(models.Model): sso_url = models.URLField(verbose_name="SSO URL") public_key = models.TextField() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): verbose_name = "SAML Provider Data" verbose_name_plural = verbose_name ordering = ('-fetched_at', ) @@ -551,6 +551,6 @@ class LTIProviderConfig(ProviderConfig): return self.lti_consumer_secret return getattr(settings, 'SOCIAL_AUTH_LTI_CONSUMER_SECRETS', {}).get(self.lti_consumer_key, '') - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): verbose_name = "Provider Configuration (LTI)" verbose_name_plural = verbose_name diff --git a/common/djangoapps/track/backends/django.py b/common/djangoapps/track/backends/django.py index 4fffc86d25a57d17821f1607c05adeae82c5a512..cc06e7cf365ed3b5c70b53ab191ec49cef207cfc 100644 --- a/common/djangoapps/track/backends/django.py +++ b/common/djangoapps/track/backends/django.py @@ -46,7 +46,7 @@ class TrackingLog(models.Model): time = models.DateTimeField('event time') host = models.CharField(max_length=64, blank=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): app_label = 'track' db_table = 'track_trackinglog' diff --git a/common/lib/xmodule/xmodule/modulestore/tests/factories.py b/common/lib/xmodule/xmodule/modulestore/tests/factories.py index ebf1cc54739bb42da9c21a0a1060cacd5888993f..24f76048c23024e00ae871c32298de972f2220d6 100644 --- a/common/lib/xmodule/xmodule/modulestore/tests/factories.py +++ b/common/lib/xmodule/xmodule/modulestore/tests/factories.py @@ -74,7 +74,7 @@ class XModuleFactory(Factory): # We have to give a model for Factory. # However, the class that we create is actually determined by the category # specified in the factory - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = Dummy @lazy_attribute diff --git a/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py b/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py index 7ddf4a7004d0bd08e3d13d39cb5ec0987b60bf61..8834375946aa8dc7616368faea6111512d68c71d 100644 --- a/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py +++ b/common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py @@ -104,7 +104,7 @@ class ModuleSystemFactory(Factory): performed by :func:`xmodule.tests.get_test_system`, so arguments for that function are valid factory attributes. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = ModuleSystem @classmethod @@ -120,7 +120,7 @@ class DescriptorSystemFactory(Factory): performed by :func:`xmodule.tests.get_test_descriptor_system`, so arguments for that function are valid factory attributes. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = DescriptorSystem @classmethod diff --git a/common/lib/xmodule/xmodule/tests/xml/factories.py b/common/lib/xmodule/xmodule/tests/xml/factories.py index 946e115f1b53c6a022327f0ab99e1bba218a123a..b131a65c7608b4ef318121368b7d05902005b236 100644 --- a/common/lib/xmodule/xmodule/tests/xml/factories.py +++ b/common/lib/xmodule/xmodule/tests/xml/factories.py @@ -64,7 +64,7 @@ class XmlImportFactory(Factory): Factory for generating XmlImportData's, which can hold all the data needed to run an XModule XML import """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = XmlImportData filesystem = MemoryFS() diff --git a/common/test/acceptance/fixtures/discussion.py b/common/test/acceptance/fixtures/discussion.py index 8655be5c1ec7338e3147f30bd552088d946acad5..81ad3f6aeebee5cfc606a709cd03cf545fe8862c 100644 --- a/common/test/acceptance/fixtures/discussion.py +++ b/common/test/acceptance/fixtures/discussion.py @@ -12,8 +12,9 @@ from . import COMMENTS_STUB_URL class ContentFactory(factory.Factory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = dict + id = None user_id = "1234" username = "dummy-username" @@ -64,8 +65,9 @@ class Response(Comment): class SearchResult(factory.Factory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = dict + discussion_data = [] annotated_content_info = {} num_pages = 1 diff --git a/common/test/acceptance/fixtures/edxnotes.py b/common/test/acceptance/fixtures/edxnotes.py index 1bc1f928d02ead58e46fb2bf46625179ce5e1a88..960843e801ed442692ecfba0c1b9a84bf29cb01e 100644 --- a/common/test/acceptance/fixtures/edxnotes.py +++ b/common/test/acceptance/fixtures/edxnotes.py @@ -10,8 +10,9 @@ from . import EDXNOTES_STUB_URL class Range(factory.Factory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = dict + start = "/div[1]/p[1]" end = "/div[1]/p[1]" startOffset = 0 @@ -19,8 +20,9 @@ class Range(factory.Factory): class Note(factory.Factory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = dict + user = "dummy-user" usage_id = "dummy-usage-id" course_id = "dummy-course-id" diff --git a/lms/djangoapps/bulk_email/forms.py b/lms/djangoapps/bulk_email/forms.py index e9ef4c94136bc306fc82c3ae472bf8e0e2a242a8..b864432457903b2d1058c663cebfec8c58e10f2b 100644 --- a/lms/djangoapps/bulk_email/forms.py +++ b/lms/djangoapps/bulk_email/forms.py @@ -22,7 +22,7 @@ class CourseEmailTemplateForm(forms.ModelForm): name = forms.CharField(required=False) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseEmailTemplate fields = ('html_template', 'plain_template', 'name') @@ -76,7 +76,7 @@ class CourseEmailTemplateForm(forms.ModelForm): class CourseAuthorizationAdminForm(forms.ModelForm): """Input form for email enabling, allowing us to verify data.""" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseAuthorization def clean_course_id(self): diff --git a/lms/djangoapps/bulk_email/models.py b/lms/djangoapps/bulk_email/models.py index b693f9503a9fe5796d903f481a421946bb269834..6fab5559d8276e27d81d20b303eaae80516c5458 100644 --- a/lms/djangoapps/bulk_email/models.py +++ b/lms/djangoapps/bulk_email/models.py @@ -44,7 +44,7 @@ class Email(models.Model): created = models.DateTimeField(auto_now_add=True) modified = models.DateTimeField(auto_now=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): abstract = True @@ -144,7 +144,7 @@ class Optout(models.Model): user = models.ForeignKey(User, db_index=True, null=True) course_id = CourseKeyField(max_length=255, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ('user', 'course_id') diff --git a/lms/djangoapps/ccx/models.py b/lms/djangoapps/ccx/models.py index 439962b0e67743d64bf46e53efc86583a16eeb88..70121dc43e992cc4c8e511252bb1a696d18a995e 100644 --- a/lms/djangoapps/ccx/models.py +++ b/lms/djangoapps/ccx/models.py @@ -103,7 +103,7 @@ class CcxFieldOverride(models.Model): location = LocationKeyField(max_length=255, db_index=True) field = models.CharField(max_length=255) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('ccx', 'location', 'field'),) value = models.TextField(default='null') diff --git a/lms/djangoapps/ccx/tests/factories.py b/lms/djangoapps/ccx/tests/factories.py index 0185ac3fbee79353dfc0c08b71a2c5f631f96fef..19ead8722468654f758be255dce7ae34299e588a 100644 --- a/lms/djangoapps/ccx/tests/factories.py +++ b/lms/djangoapps/ccx/tests/factories.py @@ -8,8 +8,9 @@ from ccx.models import CustomCourseForEdX # pylint: disable=import-error class CcxFactory(DjangoModelFactory): # pylint: disable=missing-docstring - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CustomCourseForEdX + display_name = "Test CCX" id = None # pylint: disable=redefined-builtin, invalid-name coach = SubFactory(UserFactory) diff --git a/lms/djangoapps/certificates/admin.py b/lms/djangoapps/certificates/admin.py index f3be84a07478ee3d7083737c840d654f2e2605b6..38983e29885869c1d1baebae2360725621154e1f 100644 --- a/lms/djangoapps/certificates/admin.py +++ b/lms/djangoapps/certificates/admin.py @@ -28,7 +28,6 @@ class CertificateTemplateForm(forms.ModelForm): ) class Meta(object): - """ Meta definitions for CertificateTemplateForm """ model = CertificateTemplate diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index d38799e29b2d58bf6d0a2ccb195e4476e312f9d9..560772c8ba3af96afb2b4ae8456b42d9e3e3515c 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -136,7 +136,7 @@ class GeneratedCertificate(models.Model): auto_now=True, default=datetime.now) error_reason = models.CharField(max_length=512, blank=True, default='') - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('user', 'course_id'),) @classmethod @@ -252,7 +252,7 @@ class ExampleCertificateSet(TimeStampedModel): """ course_key = CourseKeyField(max_length=255, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = 'created' @classmethod @@ -509,7 +509,7 @@ class CertificateGenerationCourseSetting(TimeStampedModel): course_key = CourseKeyField(max_length=255, db_index=True) enabled = models.BooleanField(default=False) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = 'created' @classmethod @@ -625,9 +625,6 @@ class BadgeAssertion(models.Model): return self.data['json']['id'] class Meta(object): - """ - Meta information for Django's construction of the model. - """ unique_together = (('course_id', 'user', 'mode'),) @@ -736,7 +733,7 @@ class CertificateTemplate(TimeStampedModel): def __unicode__(self): return u'%s' % (self.name, ) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = 'created' unique_together = (('organization_id', 'course_key', 'mode'),) @@ -788,7 +785,7 @@ class CertificateTemplateAsset(TimeStampedModel): def __unicode__(self): return u'%s' % (self.asset.url, ) # pylint: disable=no-member - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = 'created' diff --git a/lms/djangoapps/commerce/api/v1/serializers.py b/lms/djangoapps/commerce/api/v1/serializers.py index 775867fe85031b8570ba8972036408d7eb482185..c3680ff3e316b20ee7c058dfdea7d68e16d454ba 100644 --- a/lms/djangoapps/commerce/api/v1/serializers.py +++ b/lms/djangoapps/commerce/api/v1/serializers.py @@ -31,7 +31,7 @@ class CourseModeSerializer(serializers.ModelSerializer): except AttributeError: return None - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseMode fields = ('name', 'currency', 'price', 'sku', 'expires') diff --git a/lms/djangoapps/courseware/models.py b/lms/djangoapps/courseware/models.py index 5aae6fbde8bde90537591b0e35637dbd892218c1..a01370d21ef8d0fa7160f12ff062773eb9cde74c 100644 --- a/lms/djangoapps/courseware/models.py +++ b/lms/djangoapps/courseware/models.py @@ -101,7 +101,7 @@ class StudentModule(CallStackMixin, models.Model): course_id = CourseKeyField(max_length=255, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('student', 'module_state_key', 'course_id'),) # Internal state of the object @@ -160,7 +160,7 @@ class StudentModuleHistory(CallStackMixin, models.Model): objects = CallStackManager() HISTORY_SAVING_TYPES = {'problem'} - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = "created" student_module = models.ForeignKey(StudentModule, db_index=True) @@ -195,7 +195,7 @@ class XBlockFieldBase(models.Model): """ objects = ChunkingManager() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): abstract = True # The name of the field @@ -222,7 +222,7 @@ class XModuleUserStateSummaryField(XBlockFieldBase): """ Stores data set in the Scope.user_state_summary scope by an xmodule field """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('usage_id', 'field_name'),) # The definition id for the module @@ -233,7 +233,7 @@ class XModuleStudentPrefsField(XBlockFieldBase): """ Stores data set in the Scope.preferences scope by an xmodule field """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('student', 'module_type', 'field_name'),) # The type of the module for these preferences @@ -246,8 +246,9 @@ class XModuleStudentInfoField(XBlockFieldBase): """ Stores data set in the Scope.preferences scope by an xmodule field """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('student', 'field_name'),) + student = models.ForeignKey(User, db_index=True) @@ -263,7 +264,7 @@ class OfflineComputedGrade(models.Model): gradeset = models.TextField(null=True, blank=True) # grades, stored as JSON - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('user', 'course_id'), ) def __unicode__(self): @@ -275,7 +276,7 @@ class OfflineComputedGradeLog(models.Model): Log of when offline grades are computed. Use this to be able to show instructor when the last computed grades were done. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): ordering = ["-created"] get_latest_by = "created" @@ -298,7 +299,7 @@ class StudentFieldOverride(TimeStampedModel): location = LocationKeyField(max_length=255, db_index=True) student = models.ForeignKey(User, db_index=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('course_id', 'field', 'location', 'student'),) field = models.CharField(max_length=255) diff --git a/lms/djangoapps/django_comment_client/tests/factories.py b/lms/djangoapps/django_comment_client/tests/factories.py index d5ad2dbe7445e9431af58e0745cd8749697f0a05..c68339458847067b0100bb83e4d4dc0690bf7ba6 100644 --- a/lms/djangoapps/django_comment_client/tests/factories.py +++ b/lms/djangoapps/django_comment_client/tests/factories.py @@ -3,13 +3,15 @@ from django_comment_common.models import Role, Permission class RoleFactory(DjangoModelFactory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = Role + name = 'Student' course_id = 'edX/toy/2012_Fall' class PermissionFactory(DjangoModelFactory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = Permission + name = 'create_comment' diff --git a/lms/djangoapps/foldit/models.py b/lms/djangoapps/foldit/models.py index 78c88080f004cc96c92cbaeed97381f8cbec6726..763f3951c4a4669c43e284e48d7b7a4d609d5d07 100644 --- a/lms/djangoapps/foldit/models.py +++ b/lms/djangoapps/foldit/models.py @@ -83,7 +83,7 @@ class PuzzleComplete(models.Model): e.g. PuzzleID 1234, set 1, subset 3. (Sets and subsets correspond to levels in the intro puzzles) """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): # there should only be one puzzle complete entry for any particular # puzzle for any user unique_together = ('user', 'puzzle_id', 'puzzle_set', 'puzzle_subset') diff --git a/lms/djangoapps/instructor_task/tests/factories.py b/lms/djangoapps/instructor_task/tests/factories.py index bd62c8f378d8e9c7aefe8a30a0eedcd77fa65af2..fe376d9c679cc7b305a344466c3e1255b734e28c 100644 --- a/lms/djangoapps/instructor_task/tests/factories.py +++ b/lms/djangoapps/instructor_task/tests/factories.py @@ -9,7 +9,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey class InstructorTaskFactory(DjangoModelFactory): - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = InstructorTask task_type = 'rescore_problem' diff --git a/lms/djangoapps/licenses/tests.py b/lms/djangoapps/licenses/tests.py index 1c68c4c43a2871003ab6f378370a41424c79092a..b15820b9ede856d93e5f9b727fcd57119fd8b414 100644 --- a/lms/djangoapps/licenses/tests.py +++ b/lms/djangoapps/licenses/tests.py @@ -32,7 +32,7 @@ log = logging.getLogger(__name__) class CourseSoftwareFactory(DjangoModelFactory): '''Factory for generating CourseSoftware objects in database''' - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseSoftware name = SOFTWARE_1 @@ -48,7 +48,7 @@ class UserLicenseFactory(DjangoModelFactory): By default, the user assigned is null, indicating that the serial number has not yet been assigned. ''' - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = UserLicense user = None diff --git a/lms/djangoapps/lti_provider/models.py b/lms/djangoapps/lti_provider/models.py index 11f756fa718d1d72b29a7a0f4fc01e92383ea4c8..6866d923b2f23c2f22cb10951f23ac8b13ff6725 100644 --- a/lms/djangoapps/lti_provider/models.py +++ b/lms/djangoapps/lti_provider/models.py @@ -117,9 +117,6 @@ class GradedAssignment(models.Model): version_number = models.IntegerField(default=0) class Meta(object): - """ - Uniqueness constraints. - """ unique_together = ('outcome_service', 'lis_result_sourcedid') @@ -135,7 +132,4 @@ class LtiUser(models.Model): edx_user = models.ForeignKey(User, unique=True) class Meta(object): - """ - Uniqueness constraints. - """ unique_together = ('lti_consumer', 'lti_user_id') diff --git a/lms/djangoapps/mobile_api/users/serializers.py b/lms/djangoapps/mobile_api/users/serializers.py index a981861ced9eb3f9d270913d8d52dbcf859448d6..e40df4de9ca9f80196dc3bb29032efc7e27869dd 100644 --- a/lms/djangoapps/mobile_api/users/serializers.py +++ b/lms/djangoapps/mobile_api/users/serializers.py @@ -97,7 +97,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer): else: return {} - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseEnrollment fields = ('created', 'mode', 'is_active', 'course', 'certificate') lookup_field = 'username' @@ -113,7 +113,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer): lookup_field='username' ) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = User fields = ('id', 'username', 'email', 'name', 'course_enrollments') lookup_field = 'username' diff --git a/lms/djangoapps/notifier_api/serializers.py b/lms/djangoapps/notifier_api/serializers.py index 719cc9c6f1cfca74834bbb034b64904be5684b11..4ca1c06f9aeb57e5c974ae76d575a8272657805d 100644 --- a/lms/djangoapps/notifier_api/serializers.py +++ b/lms/djangoapps/notifier_api/serializers.py @@ -63,7 +63,7 @@ class NotifierUserSerializer(serializers.ModelSerializer): pass return ret - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = User fields = ("id", "email", "name", "preferences", "course_info") read_only_fields = ("id", "email") diff --git a/lms/djangoapps/shoppingcart/models.py b/lms/djangoapps/shoppingcart/models.py index 06e2801c63f377e19b48250b824206389fe27199..ac3ca6c60f91fcab5f622fb3ad1d6251ae2d492d 100644 --- a/lms/djangoapps/shoppingcart/models.py +++ b/lms/djangoapps/shoppingcart/models.py @@ -1164,7 +1164,7 @@ class InvoiceHistory(models.Model): elif hasattr(instance, 'invoice'): InvoiceHistory.save_invoice_snapshot(instance.invoice) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = "timestamp" diff --git a/lms/djangoapps/survey/admin.py b/lms/djangoapps/survey/admin.py index 9552789b9845794e6ea4761973d77eafe8609a32..b853a8445af28d136bc64bb2733a77218765dac5 100644 --- a/lms/djangoapps/survey/admin.py +++ b/lms/djangoapps/survey/admin.py @@ -10,7 +10,7 @@ from survey.models import SurveyForm class SurveyFormAdminForm(forms.ModelForm): """Form providing validation of SurveyForm content.""" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = SurveyForm fields = ('name', 'form') diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py index 13c04efe31fa04b2173a78e3fc397fff57691f9a..33080188487c51e2ca2c57cd58f89175e6d5a259 100644 --- a/lms/djangoapps/teams/models.py +++ b/lms/djangoapps/teams/models.py @@ -154,7 +154,6 @@ class CourseTeamMembership(models.Model): """This model represents the membership of a single user in a single team.""" class Meta(object): - """Stores meta information for the model.""" unique_together = (('user', 'team'),) user = models.ForeignKey(User) diff --git a/lms/djangoapps/teams/serializers.py b/lms/djangoapps/teams/serializers.py index 8befd944bc2ec4ac47e85c393db7802919596fcb..469ad09f61da7e15b60bc83404671857ecaf1d3c 100644 --- a/lms/djangoapps/teams/serializers.py +++ b/lms/djangoapps/teams/serializers.py @@ -62,7 +62,6 @@ class UserMembershipSerializer(serializers.ModelSerializer): ) class Meta(object): - """Defines meta information for the ModelSerializer.""" model = CourseTeamMembership fields = ("user", "date_joined", "last_activity_at") read_only_fields = ("date_joined", "last_activity_at") @@ -75,7 +74,6 @@ class CourseTeamSerializer(serializers.ModelSerializer): country = CountryField() class Meta(object): - """Defines meta information for the ModelSerializer.""" model = CourseTeam fields = ( "id", @@ -99,7 +97,6 @@ class CourseTeamCreationSerializer(serializers.ModelSerializer): country = CountryField(required=False) class Meta(object): - """Defines meta information for the ModelSerializer.""" model = CourseTeam fields = ( "name", @@ -161,7 +158,6 @@ class MembershipSerializer(serializers.ModelSerializer): ) class Meta(object): - """Defines meta information for the ModelSerializer.""" model = CourseTeamMembership fields = ("user", "team", "date_joined", "last_activity_at") read_only_fields = ("date_joined", "last_activity_at") @@ -209,7 +205,7 @@ class BulkTeamCountTopicSerializer(BaseTopicSerializer): # pylint: disable=abst Serializes a set of topics, adding the team_count field to each topic as a bulk operation. Requires that `context` is provided with a valid course_id in order to filter teams within the course. """ - class Meta: # pylint: disable=missing-docstring,old-style-class + class Meta(object): list_serializer_class = BulkTeamCountTopicListSerializer diff --git a/lms/djangoapps/teams/tests/factories.py b/lms/djangoapps/teams/tests/factories.py index 67bf4aa704f94f24a12c75570dd7e8935698ffc4..5127e710649e5e1b22bab727beb59517218a8df6 100644 --- a/lms/djangoapps/teams/tests/factories.py +++ b/lms/djangoapps/teams/tests/factories.py @@ -18,7 +18,7 @@ class CourseTeamFactory(DjangoModelFactory): Note that team_id is not auto-generated from name when using the factory. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseTeam django_get_or_create = ('team_id',) @@ -31,8 +31,9 @@ class CourseTeamFactory(DjangoModelFactory): class CourseTeamMembershipFactory(DjangoModelFactory): """Factory for CourseTeamMemberships.""" - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseTeamMembership + last_activity_at = LAST_ACTIVITY_AT @classmethod diff --git a/lms/djangoapps/verify_student/models.py b/lms/djangoapps/verify_student/models.py index 09045db3737c2638f8fc152eca684fea28be0a32..2d5d5dd8caf712e4209eb36c58f7f1e925a87927 100644 --- a/lms/djangoapps/verify_student/models.py +++ b/lms/djangoapps/verify_student/models.py @@ -188,7 +188,7 @@ class PhotoVerification(StatusModel): # capturing it so that we can later query for the common problems. error_code = models.CharField(blank=True, max_length=50) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): abstract = True ordering = ['-created_at'] @@ -1043,7 +1043,7 @@ class VerificationCheckpoint(models.Model): checkpoint_location = models.CharField(max_length=255) photo_verification = models.ManyToManyField(SoftwareSecurePhotoVerification) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ('course_id', 'checkpoint_location') def __unicode__(self): @@ -1152,7 +1152,7 @@ class VerificationStatus(models.Model): response = models.TextField(null=True, blank=True) error = models.TextField(null=True, blank=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): get_latest_by = "timestamp" verbose_name = "Verification Status" verbose_name_plural = "Verification Statuses" @@ -1329,7 +1329,7 @@ class SkippedReverification(models.Model): checkpoint = models.ForeignKey(VerificationCheckpoint, related_name="skipped_checkpoint") created_at = models.DateTimeField(auto_now_add=True) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('user', 'course_id'),) @classmethod diff --git a/lms/djangoapps/verify_student/tests/factories.py b/lms/djangoapps/verify_student/tests/factories.py index d24e95804c4a09699b1915656384e484ce77dd04..eb7c96de88c0f4ece12d1b1da5b487da417ab37b 100644 --- a/lms/djangoapps/verify_student/tests/factories.py +++ b/lms/djangoapps/verify_student/tests/factories.py @@ -10,7 +10,7 @@ class SoftwareSecurePhotoVerificationFactory(DjangoModelFactory): """ Factory for SoftwareSecurePhotoVerification """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = SoftwareSecurePhotoVerification status = 'approved' diff --git a/openedx/core/djangoapps/course_groups/models.py b/openedx/core/djangoapps/course_groups/models.py index ff80d96979d7f80feea7dd3fc60120e2e375e93d..e17c40fd469b8f6c74d7fb5dd9b15100f91c2377 100644 --- a/openedx/core/djangoapps/course_groups/models.py +++ b/openedx/core/djangoapps/course_groups/models.py @@ -18,7 +18,7 @@ class CourseUserGroup(models.Model): which may be treated specially. For example, a user can be in at most one cohort per course, and cohorts are used to split up the forums by group. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = (('name', 'course_id'), ) name = models.CharField(max_length=255, diff --git a/openedx/core/djangoapps/course_groups/tests/helpers.py b/openedx/core/djangoapps/course_groups/tests/helpers.py index a95b6b5e41f817d214dab30a51992645a356e7ee..639f6dcd173087efd3915c5d935db6fff4b392fc 100644 --- a/openedx/core/djangoapps/course_groups/tests/helpers.py +++ b/openedx/core/djangoapps/course_groups/tests/helpers.py @@ -18,7 +18,7 @@ class CohortFactory(DjangoModelFactory): """ Factory for constructing mock cohorts. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseUserGroup name = Sequence("cohort{}".format) @@ -38,7 +38,7 @@ class CourseCohortFactory(DjangoModelFactory): """ Factory for constructing mock course cohort. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseCohort course_user_group = factory.SubFactory(CohortFactory) @@ -49,7 +49,7 @@ class CourseCohortSettingsFactory(DjangoModelFactory): """ Factory for constructing mock course cohort settings. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CourseCohortsSettings is_cohorted = False diff --git a/openedx/core/djangoapps/credit/admin.py b/openedx/core/djangoapps/credit/admin.py index 357911dd55fa87c82f2f5e2dd0d37796d913785a..744c8f06882ff1dde2f4ed4b0f71c9d4011f7a02 100644 --- a/openedx/core/djangoapps/credit/admin.py +++ b/openedx/core/djangoapps/credit/admin.py @@ -13,7 +13,7 @@ class CreditCourseAdmin(admin.ModelAdmin): list_filter = ('enabled',) search_fields = ('course_key',) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CreditCourse @@ -23,7 +23,7 @@ class CreditProviderAdmin(admin.ModelAdmin): list_filter = ('active',) search_fields = ('provider_id', 'display_name') - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CreditProvider @@ -32,7 +32,7 @@ class CreditEligibilityAdmin(admin.ModelAdmin): list_display = ('course', 'username', 'deadline') search_fields = ('username', 'course__course_key') - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CreditEligibility @@ -43,7 +43,7 @@ class CreditRequestAdmin(admin.ModelAdmin): readonly_fields = ('uuid',) search_fields = ('uuid', 'username', 'course__course_key', 'provider__provider_id') - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CreditRequest diff --git a/openedx/core/djangoapps/credit/models.py b/openedx/core/djangoapps/credit/models.py index 895faaa2df809524ceeccd5ce133ec504a7d37a0..378d8c20a226ca952a5c6a04b7df71fd768d74a7 100644 --- a/openedx/core/djangoapps/credit/models.py +++ b/openedx/core/djangoapps/credit/models.py @@ -291,9 +291,6 @@ class CreditRequirement(TimeStampedModel): active = models.BooleanField(default=True) class Meta(object): - """ - Model metadata. - """ unique_together = ('namespace', 'name', 'course') ordering = ["order"] @@ -428,7 +425,7 @@ class CreditRequirementStatus(TimeStampedModel): # Maintain a history of requirement status updates for auditing purposes history = HistoricalRecords() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ('username', 'requirement') @classmethod @@ -515,7 +512,7 @@ class CreditEligibility(TimeStampedModel): help_text=ugettext_lazy("Deadline for purchasing and requesting credit.") ) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ('username', 'course') verbose_name_plural = "Credit eligibilities" @@ -637,7 +634,7 @@ class CreditRequest(TimeStampedModel): history = HistoricalRecords() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): # Enforce the constraint that each user can have exactly one outstanding # request to a given provider. Multiple requests use the same UUID. unique_together = ('username', 'course', 'provider') diff --git a/openedx/core/djangoapps/credit/serializers.py b/openedx/core/djangoapps/credit/serializers.py index 4e43a139fc225669fc15728a88ddf5e0f84ebf69..216aa1fa050d316cc7a286647602cc713666c01e 100644 --- a/openedx/core/djangoapps/credit/serializers.py +++ b/openedx/core/djangoapps/credit/serializers.py @@ -29,6 +29,6 @@ class CreditCourseSerializer(serializers.ModelSerializer): course_key = CourseKeyField() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = CreditCourse exclude = ('id',) diff --git a/openedx/core/djangoapps/user_api/accounts/serializers.py b/openedx/core/djangoapps/user_api/accounts/serializers.py index fff44bbbf74fc2835497324e04990e9bbfad98e7..65e87dfe37a11d42fa21311c056d34933477e685 100644 --- a/openedx/core/djangoapps/user_api/accounts/serializers.py +++ b/openedx/core/djangoapps/user_api/accounts/serializers.py @@ -24,7 +24,7 @@ class LanguageProficiencySerializer(serializers.ModelSerializer): Class that serializes the LanguageProficiency model for account information. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = LanguageProficiency fields = ("code",) @@ -143,7 +143,7 @@ class AccountUserSerializer(serializers.HyperlinkedModelSerializer, ReadOnlyFiel """ Class that serializes the portion of User model needed for account information. """ - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = User fields = ("username", "email", "date_joined", "is_active") read_only_fields = ("username", "email", "date_joined", "is_active") @@ -158,7 +158,7 @@ class AccountLegacyProfileSerializer(serializers.HyperlinkedModelSerializer, Rea requires_parental_consent = serializers.SerializerMethodField() language_proficiencies = LanguageProficiencySerializer(many=True, required=False) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = UserProfile fields = ( "name", "gender", "goals", "year_of_birth", "level_of_education", "country", diff --git a/openedx/core/djangoapps/user_api/models.py b/openedx/core/djangoapps/user_api/models.py index 3f934c80336536725a3d5d94d62a5fd19b169aad..6d893ef6f3d52ab22d0c61915d0a0acfc1c301c2 100644 --- a/openedx/core/djangoapps/user_api/models.py +++ b/openedx/core/djangoapps/user_api/models.py @@ -27,7 +27,7 @@ class UserPreference(models.Model): key = models.CharField(max_length=255, db_index=True, validators=[RegexValidator(KEY_REGEX)]) value = models.TextField() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ("user", "key") @classmethod @@ -96,7 +96,7 @@ class UserCourseTag(models.Model): course_id = CourseKeyField(max_length=255, db_index=True) value = models.TextField() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): unique_together = ("user", "course_id", "key") @@ -112,5 +112,4 @@ class UserOrgTag(TimeStampedModel): value = models.TextField() class Meta(object): - """ Meta class for defining unique constraints. """ unique_together = ("user", "org", "key") diff --git a/openedx/core/djangoapps/user_api/serializers.py b/openedx/core/djangoapps/user_api/serializers.py index bb2bac9592f8c25cbdead88a4a4b571f5251818f..b7a71f0eb5e5f44fef1d85b88e96940f01785a09 100644 --- a/openedx/core/djangoapps/user_api/serializers.py +++ b/openedx/core/djangoapps/user_api/serializers.py @@ -28,7 +28,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer): """ return dict([(pref.key, pref.value) for pref in user.preferences.all()]) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = User # This list is the minimal set required by the notification service fields = ("id", "url", "email", "name", "username", "preferences") @@ -41,7 +41,7 @@ class UserPreferenceSerializer(serializers.HyperlinkedModelSerializer): """ user = UserSerializer() - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = UserPreference depth = 1 @@ -52,7 +52,7 @@ class RawUserPreferenceSerializer(serializers.ModelSerializer): """ user = serializers.PrimaryKeyRelatedField(queryset=User.objects.all()) - class Meta(object): # pylint: disable=missing-docstring + class Meta(object): model = UserPreference depth = 1 diff --git a/openedx/core/lib/api/serializers.py b/openedx/core/lib/api/serializers.py index b13bbc2d83c35012623e159f394c2250413ffe4a..c0ac83796d402f421240f71c76a89b3e5f4cc6a7 100644 --- a/openedx/core/lib/api/serializers.py +++ b/openedx/core/lib/api/serializers.py @@ -36,8 +36,4 @@ class CollapsedReferenceSerializer(serializers.HyperlinkedModelSerializer): self.fields['url'].lookup_url_kwarg = lookup_field class Meta(object): - """Defines meta information for the ModelSerializer. - - model is set dynamically in __init__. - """ fields = ("url",)