Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a0c25f88
Commit
a0c25f88
authored
Oct 21, 2015
by
Ned Batchelder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10279 from edx/ned/cleaner-django-meta
No need for docstrings on "class Meta"
parents
99e6cab2
322ca34b
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
108 additions
and
124 deletions
+108
-124
common/djangoapps/config_models/models.py
+1
-1
common/djangoapps/course_modes/admin.py
+1
-1
common/djangoapps/course_modes/models.py
+0
-1
common/djangoapps/django_comment_common/models.py
+2
-2
common/djangoapps/embargo/forms.py
+2
-2
common/djangoapps/embargo/models.py
+1
-1
common/djangoapps/enrollment/serializers.py
+1
-1
common/djangoapps/external_auth/models.py
+2
-1
common/djangoapps/student/admin.py
+4
-4
common/djangoapps/student/models.py
+7
-9
common/djangoapps/third_party_auth/models.py
+6
-6
common/djangoapps/track/backends/django.py
+1
-1
common/lib/xmodule/xmodule/modulestore/tests/factories.py
+1
-1
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
+2
-2
common/lib/xmodule/xmodule/tests/xml/factories.py
+1
-1
common/test/acceptance/fixtures/discussion.py
+4
-2
common/test/acceptance/fixtures/edxnotes.py
+4
-2
lms/djangoapps/bulk_email/forms.py
+2
-2
lms/djangoapps/bulk_email/models.py
+2
-2
lms/djangoapps/ccx/models.py
+1
-1
lms/djangoapps/ccx/tests/factories.py
+2
-1
lms/djangoapps/certificates/admin.py
+0
-1
lms/djangoapps/certificates/models.py
+5
-8
lms/djangoapps/commerce/api/v1/serializers.py
+1
-1
lms/djangoapps/courseware/models.py
+10
-9
lms/djangoapps/django_comment_client/tests/factories.py
+4
-2
lms/djangoapps/foldit/models.py
+1
-1
lms/djangoapps/instructor_task/tests/factories.py
+1
-1
lms/djangoapps/licenses/tests.py
+2
-2
lms/djangoapps/lti_provider/models.py
+0
-6
lms/djangoapps/mobile_api/users/serializers.py
+2
-2
lms/djangoapps/notifier_api/serializers.py
+1
-1
lms/djangoapps/shoppingcart/models.py
+1
-1
lms/djangoapps/survey/admin.py
+1
-1
lms/djangoapps/teams/models.py
+0
-1
lms/djangoapps/teams/serializers.py
+1
-5
lms/djangoapps/teams/tests/factories.py
+3
-2
lms/djangoapps/verify_student/models.py
+4
-4
lms/djangoapps/verify_student/tests/factories.py
+1
-1
openedx/core/djangoapps/course_groups/models.py
+1
-1
openedx/core/djangoapps/course_groups/tests/helpers.py
+3
-3
openedx/core/djangoapps/credit/admin.py
+4
-4
openedx/core/djangoapps/credit/models.py
+3
-6
openedx/core/djangoapps/credit/serializers.py
+1
-1
openedx/core/djangoapps/user_api/accounts/serializers.py
+3
-3
openedx/core/djangoapps/user_api/models.py
+2
-3
openedx/core/djangoapps/user_api/serializers.py
+3
-3
openedx/core/lib/api/serializers.py
+0
-4
pylintrc
+2
-2
requirements/edx/github.txt
+1
-1
No files found.
common/djangoapps/config_models/models.py
View file @
a0c25f88
...
@@ -67,7 +67,7 @@ class ConfigurationModel(models.Model):
...
@@ -67,7 +67,7 @@ class ConfigurationModel(models.Model):
should be cached
should be cached
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
abstract
=
True
abstract
=
True
ordering
=
(
"-change_date"
,
)
ordering
=
(
"-change_date"
,
)
...
...
common/djangoapps/course_modes/admin.py
View file @
a0c25f88
...
@@ -31,7 +31,7 @@ from verify_student import models as verification_models # pylint: disable=impo
...
@@ -31,7 +31,7 @@ from verify_student import models as verification_models # pylint: disable=impo
class
CourseModeForm
(
forms
.
ModelForm
):
class
CourseModeForm
(
forms
.
ModelForm
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseMode
model
=
CourseMode
COURSE_MODE_SLUG_CHOICES
=
(
COURSE_MODE_SLUG_CHOICES
=
(
...
...
common/djangoapps/course_modes/models.py
View file @
a0c25f88
...
@@ -110,7 +110,6 @@ class CourseMode(models.Model):
...
@@ -110,7 +110,6 @@ class CourseMode(models.Model):
UPSELL_TO_VERIFIED_MODES
=
[
HONOR
]
UPSELL_TO_VERIFIED_MODES
=
[
HONOR
]
class
Meta
(
object
):
class
Meta
(
object
):
""" meta attributes of this model """
unique_together
=
(
'course_id'
,
'mode_slug'
,
'currency'
)
unique_together
=
(
'course_id'
,
'mode_slug'
,
'currency'
)
def
clean
(
self
):
def
clean
(
self
):
...
...
common/djangoapps/django_comment_common/models.py
View file @
a0c25f88
...
@@ -57,7 +57,7 @@ class Role(models.Model):
...
@@ -57,7 +57,7 @@ class Role(models.Model):
users
=
models
.
ManyToManyField
(
User
,
related_name
=
"roles"
)
users
=
models
.
ManyToManyField
(
User
,
related_name
=
"roles"
)
course_id
=
CourseKeyField
(
max_length
=
255
,
blank
=
True
,
db_index
=
True
)
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
# use existing table that was originally created from django_comment_client app
db_table
=
'django_comment_client_role'
db_table
=
'django_comment_client_role'
...
@@ -99,7 +99,7 @@ class Permission(models.Model):
...
@@ -99,7 +99,7 @@ class Permission(models.Model):
name
=
models
.
CharField
(
max_length
=
30
,
null
=
False
,
blank
=
False
,
primary_key
=
True
)
name
=
models
.
CharField
(
max_length
=
30
,
null
=
False
,
blank
=
False
,
primary_key
=
True
)
roles
=
models
.
ManyToManyField
(
Role
,
related_name
=
"permissions"
)
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
# use existing table that was originally created from django_comment_client app
db_table
=
'django_comment_client_permission'
db_table
=
'django_comment_client_permission'
...
...
common/djangoapps/embargo/forms.py
View file @
a0c25f88
...
@@ -25,7 +25,7 @@ class RestrictedCourseForm(forms.ModelForm):
...
@@ -25,7 +25,7 @@ class RestrictedCourseForm(forms.ModelForm):
error message instead.
error message instead.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
RestrictedCourse
model
=
RestrictedCourse
def
clean_course_key
(
self
):
def
clean_course_key
(
self
):
...
@@ -58,7 +58,7 @@ class RestrictedCourseForm(forms.ModelForm):
...
@@ -58,7 +58,7 @@ class RestrictedCourseForm(forms.ModelForm):
class
IPFilterForm
(
forms
.
ModelForm
):
class
IPFilterForm
(
forms
.
ModelForm
):
"""Form validating entry of IP addresses"""
"""Form validating entry of IP addresses"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
IPFilter
model
=
IPFilter
def
_is_valid_ip
(
self
,
address
):
def
_is_valid_ip
(
self
,
address
):
...
...
common/djangoapps/embargo/models.py
View file @
a0c25f88
...
@@ -646,7 +646,7 @@ class CourseAccessRuleHistory(models.Model):
...
@@ -646,7 +646,7 @@ class CourseAccessRuleHistory(models.Model):
else
:
else
:
CourseAccessRuleHistory
.
save_snapshot
(
restricted_course
)
CourseAccessRuleHistory
.
save_snapshot
(
restricted_course
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
'timestamp'
get_latest_by
=
'timestamp'
...
...
common/djangoapps/enrollment/serializers.py
View file @
a0c25f88
...
@@ -76,7 +76,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer):
...
@@ -76,7 +76,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer):
"""Retrieves the username from the associated model."""
"""Retrieves the username from the associated model."""
return
model
.
username
return
model
.
username
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseEnrollment
model
=
CourseEnrollment
fields
=
(
'created'
,
'mode'
,
'is_active'
,
'course_details'
,
'user'
)
fields
=
(
'created'
,
'mode'
,
'is_active'
,
'course_details'
,
'user'
)
lookup_field
=
'username'
lookup_field
=
'username'
...
...
common/djangoapps/external_auth/models.py
View file @
a0c25f88
...
@@ -14,8 +14,9 @@ from django.contrib.auth.models import User
...
@@ -14,8 +14,9 @@ from django.contrib.auth.models import User
class
ExternalAuthMap
(
models
.
Model
):
class
ExternalAuthMap
(
models
.
Model
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
((
'external_id'
,
'external_domain'
),
)
unique_together
=
((
'external_id'
,
'external_domain'
),
)
external_id
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)
external_id
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
)
external_domain
=
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
external_credentials
=
models
.
TextField
(
blank
=
True
)
# JSON dictionary
...
...
common/djangoapps/student/admin.py
View file @
a0c25f88
...
@@ -17,7 +17,7 @@ from student.roles import REGISTERED_ACCESS_ROLES
...
@@ -17,7 +17,7 @@ from student.roles import REGISTERED_ACCESS_ROLES
class
CourseAccessRoleForm
(
forms
.
ModelForm
):
class
CourseAccessRoleForm
(
forms
.
ModelForm
):
"""Form for adding new Course Access Roles view the Django Admin Panel."""
"""Form for adding new Course Access Roles view the Django Admin Panel."""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseAccessRole
model
=
CourseAccessRole
email
=
forms
.
EmailField
(
required
=
True
)
email
=
forms
.
EmailField
(
required
=
True
)
...
@@ -125,7 +125,7 @@ class CourseAccessRoleAdmin(admin.ModelAdmin):
...
@@ -125,7 +125,7 @@ class CourseAccessRoleAdmin(admin.ModelAdmin):
class
LinkedInAddToProfileConfigurationAdmin
(
admin
.
ModelAdmin
):
class
LinkedInAddToProfileConfigurationAdmin
(
admin
.
ModelAdmin
):
"""Admin interface for the LinkedIn Add to Profile configuration. """
"""Admin interface for the LinkedIn Add to Profile configuration. """
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
LinkedInAddToProfileConfiguration
model
=
LinkedInAddToProfileConfiguration
# Exclude deprecated fields
# Exclude deprecated fields
...
@@ -144,7 +144,7 @@ class CourseEnrollmentAdmin(admin.ModelAdmin):
...
@@ -144,7 +144,7 @@ class CourseEnrollmentAdmin(admin.ModelAdmin):
return
self
.
readonly_fields
+
(
'course_id'
,
'mode'
,
'user'
,)
return
self
.
readonly_fields
+
(
'course_id'
,
'mode'
,
'user'
,)
return
self
.
readonly_fields
return
self
.
readonly_fields
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseEnrollment
model
=
CourseEnrollment
...
@@ -159,7 +159,7 @@ class UserProfileAdmin(admin.ModelAdmin):
...
@@ -159,7 +159,7 @@ class UserProfileAdmin(admin.ModelAdmin):
return
self
.
readonly_fields
+
(
'user'
,)
return
self
.
readonly_fields
+
(
'user'
,)
return
self
.
readonly_fields
return
self
.
readonly_fields
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
UserProfile
model
=
UserProfile
...
...
common/djangoapps/student/models.py
View file @
a0c25f88
...
@@ -216,7 +216,7 @@ class UserProfile(models.Model):
...
@@ -216,7 +216,7 @@ class UserProfile(models.Model):
# cache key format e.g user.<user_id>.profile.country = 'SG'
# cache key format e.g user.<user_id>.profile.country = 'SG'
PROFILE_COUNTRY_CACHE_KEY
=
u"user.{user_id}.profile.country"
PROFILE_COUNTRY_CACHE_KEY
=
u"user.{user_id}.profile.country"
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
db_table
=
"auth_userprofile"
db_table
=
"auth_userprofile"
# CRITICAL TODO/SECURITY
# CRITICAL TODO/SECURITY
...
@@ -487,7 +487,8 @@ class Registration(models.Model):
...
@@ -487,7 +487,8 @@ class Registration(models.Model):
registration profile is created when the user creates an
registration profile is created when the user creates an
account, but that account is inactive. Once the user clicks
account, but that account is inactive. Once the user clicks
on the activation key, it becomes active. '''
on the activation key, it becomes active. '''
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
db_table
=
"auth_registration"
db_table
=
"auth_registration"
user
=
models
.
ForeignKey
(
User
,
unique
=
True
)
user
=
models
.
ForeignKey
(
User
,
unique
=
True
)
...
@@ -903,7 +904,7 @@ class CourseEnrollment(models.Model):
...
@@ -903,7 +904,7 @@ class CourseEnrollment(models.Model):
# cache key format e.g enrollment.<username>.<course_key>.mode = 'honor'
# cache key format e.g enrollment.<username>.<course_key>.mode = 'honor'
COURSE_ENROLLMENT_CACHE_KEY
=
u"enrollment.{}.{}.mode"
COURSE_ENROLLMENT_CACHE_KEY
=
u"enrollment.{}.{}.mode"
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
((
'user'
,
'course_id'
),)
unique_together
=
((
'user'
,
'course_id'
),)
ordering
=
(
'user'
,
'course_id'
)
ordering
=
(
'user'
,
'course_id'
)
...
@@ -1516,7 +1517,7 @@ class CourseEnrollmentAllowed(models.Model):
...
@@ -1516,7 +1517,7 @@ class CourseEnrollmentAllowed(models.Model):
created
=
models
.
DateTimeField
(
auto_now_add
=
True
,
null
=
True
,
db_index
=
True
)
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'
),)
unique_together
=
((
'email'
,
'course_id'
),)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -1553,7 +1554,7 @@ class CourseAccessRole(models.Model):
...
@@ -1553,7 +1554,7 @@ class CourseAccessRole(models.Model):
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
,
blank
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
,
blank
=
True
)
role
=
models
.
CharField
(
max_length
=
64
,
db_index
=
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'
)
unique_together
=
(
'user'
,
'org'
,
'course_id'
,
'role'
)
@property
@property
...
@@ -1882,9 +1883,6 @@ class EntranceExamConfiguration(models.Model):
...
@@ -1882,9 +1883,6 @@ class EntranceExamConfiguration(models.Model):
skip_entrance_exam
=
models
.
BooleanField
(
default
=
True
)
skip_entrance_exam
=
models
.
BooleanField
(
default
=
True
)
class
Meta
(
object
):
class
Meta
(
object
):
"""
Meta class to make user and course_id unique in the table
"""
unique_together
=
((
'user'
,
'course_id'
),
)
unique_together
=
((
'user'
,
'course_id'
),
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -1944,7 +1942,7 @@ class LanguageProficiency(models.Model):
...
@@ -1944,7 +1942,7 @@ class LanguageProficiency(models.Model):
/edx-platform/openedx/core/djangoapps/user_api/accounts/views.py or its associated api method
/edx-platform/openedx/core/djangoapps/user_api/accounts/views.py or its associated api method
(update_account_settings) so that the events are emitted.
(update_account_settings) so that the events are emitted.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
((
'code'
,
'user_profile'
),)
unique_together
=
((
'code'
,
'user_profile'
),)
user_profile
=
models
.
ForeignKey
(
UserProfile
,
db_index
=
True
,
related_name
=
'language_proficiencies'
)
user_profile
=
models
.
ForeignKey
(
UserProfile
,
db_index
=
True
,
related_name
=
'language_proficiencies'
)
...
...
common/djangoapps/third_party_auth/models.py
View file @
a0c25f88
...
@@ -104,7 +104,7 @@ class ProviderConfig(ConfigurationModel):
...
@@ -104,7 +104,7 @@ class ProviderConfig(ConfigurationModel):
# "enabled" field is inherited from ConfigurationModel
# "enabled" field is inherited from ConfigurationModel
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
abstract
=
True
abstract
=
True
@property
@property
...
@@ -203,7 +203,7 @@ class OAuth2ProviderConfig(ProviderConfig):
...
@@ -203,7 +203,7 @@ class OAuth2ProviderConfig(ProviderConfig):
)
)
other_settings
=
models
.
TextField
(
blank
=
True
,
help_text
=
"Optional JSON object with advanced settings, if any."
)
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
=
"Provider Configuration (OAuth)"
verbose_name_plural
=
verbose_name
verbose_name_plural
=
verbose_name
...
@@ -282,7 +282,7 @@ class SAMLProviderConfig(ProviderConfig):
...
@@ -282,7 +282,7 @@ class SAMLProviderConfig(ProviderConfig):
super
(
SAMLProviderConfig
,
self
)
.
clean
()
super
(
SAMLProviderConfig
,
self
)
.
clean
()
self
.
other_settings
=
clean_json
(
self
.
other_settings
,
dict
)
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
=
"Provider Configuration (SAML IdP)"
verbose_name_plural
=
"Provider Configuration (SAML IdPs)"
verbose_name_plural
=
"Provider Configuration (SAML IdPs)"
...
@@ -373,7 +373,7 @@ class SAMLConfiguration(ConfigurationModel):
...
@@ -373,7 +373,7 @@ class SAMLConfiguration(ConfigurationModel):
),
),
)
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
verbose_name
=
"SAML Configuration"
verbose_name
=
"SAML Configuration"
verbose_name_plural
=
verbose_name
verbose_name_plural
=
verbose_name
...
@@ -439,7 +439,7 @@ class SAMLProviderData(models.Model):
...
@@ -439,7 +439,7 @@ class SAMLProviderData(models.Model):
sso_url
=
models
.
URLField
(
verbose_name
=
"SSO URL"
)
sso_url
=
models
.
URLField
(
verbose_name
=
"SSO URL"
)
public_key
=
models
.
TextField
()
public_key
=
models
.
TextField
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
verbose_name
=
"SAML Provider Data"
verbose_name
=
"SAML Provider Data"
verbose_name_plural
=
verbose_name
verbose_name_plural
=
verbose_name
ordering
=
(
'-fetched_at'
,
)
ordering
=
(
'-fetched_at'
,
)
...
@@ -551,6 +551,6 @@ class LTIProviderConfig(ProviderConfig):
...
@@ -551,6 +551,6 @@ class LTIProviderConfig(ProviderConfig):
return
self
.
lti_consumer_secret
return
self
.
lti_consumer_secret
return
getattr
(
settings
,
'SOCIAL_AUTH_LTI_CONSUMER_SECRETS'
,
{})
.
get
(
self
.
lti_consumer_key
,
''
)
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
=
"Provider Configuration (LTI)"
verbose_name_plural
=
verbose_name
verbose_name_plural
=
verbose_name
common/djangoapps/track/backends/django.py
View file @
a0c25f88
...
@@ -46,7 +46,7 @@ class TrackingLog(models.Model):
...
@@ -46,7 +46,7 @@ class TrackingLog(models.Model):
time
=
models
.
DateTimeField
(
'event time'
)
time
=
models
.
DateTimeField
(
'event time'
)
host
=
models
.
CharField
(
max_length
=
64
,
blank
=
True
)
host
=
models
.
CharField
(
max_length
=
64
,
blank
=
True
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
app_label
=
'track'
app_label
=
'track'
db_table
=
'track_trackinglog'
db_table
=
'track_trackinglog'
...
...
common/lib/xmodule/xmodule/modulestore/tests/factories.py
View file @
a0c25f88
...
@@ -74,7 +74,7 @@ class XModuleFactory(Factory):
...
@@ -74,7 +74,7 @@ class XModuleFactory(Factory):
# We have to give a model for Factory.
# We have to give a model for Factory.
# However, the class that we create is actually determined by the category
# However, the class that we create is actually determined by the category
# specified in the factory
# specified in the factory
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
Dummy
model
=
Dummy
@lazy_attribute
@lazy_attribute
...
...
common/lib/xmodule/xmodule/tests/test_xblock_wrappers.py
View file @
a0c25f88
...
@@ -104,7 +104,7 @@ class ModuleSystemFactory(Factory):
...
@@ -104,7 +104,7 @@ class ModuleSystemFactory(Factory):
performed by :func:`xmodule.tests.get_test_system`, so
performed by :func:`xmodule.tests.get_test_system`, so
arguments for that function are valid factory attributes.
arguments for that function are valid factory attributes.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
ModuleSystem
model
=
ModuleSystem
@classmethod
@classmethod
...
@@ -120,7 +120,7 @@ class DescriptorSystemFactory(Factory):
...
@@ -120,7 +120,7 @@ class DescriptorSystemFactory(Factory):
performed by :func:`xmodule.tests.get_test_descriptor_system`, so
performed by :func:`xmodule.tests.get_test_descriptor_system`, so
arguments for that function are valid factory attributes.
arguments for that function are valid factory attributes.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
DescriptorSystem
model
=
DescriptorSystem
@classmethod
@classmethod
...
...
common/lib/xmodule/xmodule/tests/xml/factories.py
View file @
a0c25f88
...
@@ -64,7 +64,7 @@ class XmlImportFactory(Factory):
...
@@ -64,7 +64,7 @@ class XmlImportFactory(Factory):
Factory for generating XmlImportData's, which can hold all the data needed
Factory for generating XmlImportData's, which can hold all the data needed
to run an XModule XML import
to run an XModule XML import
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
XmlImportData
model
=
XmlImportData
filesystem
=
MemoryFS
()
filesystem
=
MemoryFS
()
...
...
common/test/acceptance/fixtures/discussion.py
View file @
a0c25f88
...
@@ -12,8 +12,9 @@ from . import COMMENTS_STUB_URL
...
@@ -12,8 +12,9 @@ from . import COMMENTS_STUB_URL
class
ContentFactory
(
factory
.
Factory
):
class
ContentFactory
(
factory
.
Factory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
dict
model
=
dict
id
=
None
id
=
None
user_id
=
"1234"
user_id
=
"1234"
username
=
"dummy-username"
username
=
"dummy-username"
...
@@ -64,8 +65,9 @@ class Response(Comment):
...
@@ -64,8 +65,9 @@ class Response(Comment):
class
SearchResult
(
factory
.
Factory
):
class
SearchResult
(
factory
.
Factory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
dict
model
=
dict
discussion_data
=
[]
discussion_data
=
[]
annotated_content_info
=
{}
annotated_content_info
=
{}
num_pages
=
1
num_pages
=
1
...
...
common/test/acceptance/fixtures/edxnotes.py
View file @
a0c25f88
...
@@ -10,8 +10,9 @@ from . import EDXNOTES_STUB_URL
...
@@ -10,8 +10,9 @@ from . import EDXNOTES_STUB_URL
class
Range
(
factory
.
Factory
):
class
Range
(
factory
.
Factory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
dict
model
=
dict
start
=
"/div[1]/p[1]"
start
=
"/div[1]/p[1]"
end
=
"/div[1]/p[1]"
end
=
"/div[1]/p[1]"
startOffset
=
0
startOffset
=
0
...
@@ -19,8 +20,9 @@ class Range(factory.Factory):
...
@@ -19,8 +20,9 @@ class Range(factory.Factory):
class
Note
(
factory
.
Factory
):
class
Note
(
factory
.
Factory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
dict
model
=
dict
user
=
"dummy-user"
user
=
"dummy-user"
usage_id
=
"dummy-usage-id"
usage_id
=
"dummy-usage-id"
course_id
=
"dummy-course-id"
course_id
=
"dummy-course-id"
...
...
lms/djangoapps/bulk_email/forms.py
View file @
a0c25f88
...
@@ -22,7 +22,7 @@ class CourseEmailTemplateForm(forms.ModelForm):
...
@@ -22,7 +22,7 @@ class CourseEmailTemplateForm(forms.ModelForm):
name
=
forms
.
CharField
(
required
=
False
)
name
=
forms
.
CharField
(
required
=
False
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseEmailTemplate
model
=
CourseEmailTemplate
fields
=
(
'html_template'
,
'plain_template'
,
'name'
)
fields
=
(
'html_template'
,
'plain_template'
,
'name'
)
...
@@ -76,7 +76,7 @@ class CourseEmailTemplateForm(forms.ModelForm):
...
@@ -76,7 +76,7 @@ class CourseEmailTemplateForm(forms.ModelForm):
class
CourseAuthorizationAdminForm
(
forms
.
ModelForm
):
class
CourseAuthorizationAdminForm
(
forms
.
ModelForm
):
"""Input form for email enabling, allowing us to verify data."""
"""Input form for email enabling, allowing us to verify data."""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseAuthorization
model
=
CourseAuthorization
def
clean_course_id
(
self
):
def
clean_course_id
(
self
):
...
...
lms/djangoapps/bulk_email/models.py
View file @
a0c25f88
...
@@ -44,7 +44,7 @@ class Email(models.Model):
...
@@ -44,7 +44,7 @@ class Email(models.Model):
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
modified
=
models
.
DateTimeField
(
auto_now
=
True
)
modified
=
models
.
DateTimeField
(
auto_now
=
True
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
abstract
=
True
abstract
=
True
...
@@ -144,7 +144,7 @@ class Optout(models.Model):
...
@@ -144,7 +144,7 @@ class Optout(models.Model):
user
=
models
.
ForeignKey
(
User
,
db_index
=
True
,
null
=
True
)
user
=
models
.
ForeignKey
(
User
,
db_index
=
True
,
null
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
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'
)
unique_together
=
(
'user'
,
'course_id'
)
...
...
lms/djangoapps/ccx/models.py
View file @
a0c25f88
...
@@ -103,7 +103,7 @@ class CcxFieldOverride(models.Model):
...
@@ -103,7 +103,7 @@ class CcxFieldOverride(models.Model):
location
=
LocationKeyField
(
max_length
=
255
,
db_index
=
True
)
location
=
LocationKeyField
(
max_length
=
255
,
db_index
=
True
)
field
=
models
.
CharField
(
max_length
=
255
)
field
=
models
.
CharField
(
max_length
=
255
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
((
'ccx'
,
'location'
,
'field'
),)
unique_together
=
((
'ccx'
,
'location'
,
'field'
),)
value
=
models
.
TextField
(
default
=
'null'
)
value
=
models
.
TextField
(
default
=
'null'
)
lms/djangoapps/ccx/tests/factories.py
View file @
a0c25f88
...
@@ -8,8 +8,9 @@ from ccx.models import CustomCourseForEdX # pylint: disable=import-error
...
@@ -8,8 +8,9 @@ from ccx.models import CustomCourseForEdX # pylint: disable=import-error
class
CcxFactory
(
DjangoModelFactory
):
# pylint: disable=missing-docstring
class
CcxFactory
(
DjangoModelFactory
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CustomCourseForEdX
model
=
CustomCourseForEdX
display_name
=
"Test CCX"
display_name
=
"Test CCX"
id
=
None
# pylint: disable=redefined-builtin, invalid-name
id
=
None
# pylint: disable=redefined-builtin, invalid-name
coach
=
SubFactory
(
UserFactory
)
coach
=
SubFactory
(
UserFactory
)
lms/djangoapps/certificates/admin.py
View file @
a0c25f88
...
@@ -28,7 +28,6 @@ class CertificateTemplateForm(forms.ModelForm):
...
@@ -28,7 +28,6 @@ class CertificateTemplateForm(forms.ModelForm):
)
)
class
Meta
(
object
):
class
Meta
(
object
):
""" Meta definitions for CertificateTemplateForm """
model
=
CertificateTemplate
model
=
CertificateTemplate
...
...
lms/djangoapps/certificates/models.py
View file @
a0c25f88
...
@@ -136,7 +136,7 @@ class GeneratedCertificate(models.Model):
...
@@ -136,7 +136,7 @@ class GeneratedCertificate(models.Model):
auto_now
=
True
,
default
=
datetime
.
now
)
auto_now
=
True
,
default
=
datetime
.
now
)
error_reason
=
models
.
CharField
(
max_length
=
512
,
blank
=
True
,
default
=
''
)
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'
),)
unique_together
=
((
'user'
,
'course_id'
),)
@classmethod
@classmethod
...
@@ -252,7 +252,7 @@ class ExampleCertificateSet(TimeStampedModel):
...
@@ -252,7 +252,7 @@ class ExampleCertificateSet(TimeStampedModel):
"""
"""
course_key
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
course_key
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
'created'
get_latest_by
=
'created'
@classmethod
@classmethod
...
@@ -509,7 +509,7 @@ class CertificateGenerationCourseSetting(TimeStampedModel):
...
@@ -509,7 +509,7 @@ class CertificateGenerationCourseSetting(TimeStampedModel):
course_key
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
course_key
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
enabled
=
models
.
BooleanField
(
default
=
False
)
enabled
=
models
.
BooleanField
(
default
=
False
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
'created'
get_latest_by
=
'created'
@classmethod
@classmethod
...
@@ -625,9 +625,6 @@ class BadgeAssertion(models.Model):
...
@@ -625,9 +625,6 @@ class BadgeAssertion(models.Model):
return
self
.
data
[
'json'
][
'id'
]
return
self
.
data
[
'json'
][
'id'
]
class
Meta
(
object
):
class
Meta
(
object
):
"""
Meta information for Django's construction of the model.
"""
unique_together
=
((
'course_id'
,
'user'
,
'mode'
),)
unique_together
=
((
'course_id'
,
'user'
,
'mode'
),)
...
@@ -736,7 +733,7 @@ class CertificateTemplate(TimeStampedModel):
...
@@ -736,7 +733,7 @@ class CertificateTemplate(TimeStampedModel):
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
u'
%
s'
%
(
self
.
name
,
)
return
u'
%
s'
%
(
self
.
name
,
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
'created'
get_latest_by
=
'created'
unique_together
=
((
'organization_id'
,
'course_key'
,
'mode'
),)
unique_together
=
((
'organization_id'
,
'course_key'
,
'mode'
),)
...
@@ -788,7 +785,7 @@ class CertificateTemplateAsset(TimeStampedModel):
...
@@ -788,7 +785,7 @@ class CertificateTemplateAsset(TimeStampedModel):
def
__unicode__
(
self
):
def
__unicode__
(
self
):
return
u'
%
s'
%
(
self
.
asset
.
url
,
)
# pylint: disable=no-member
return
u'
%
s'
%
(
self
.
asset
.
url
,
)
# pylint: disable=no-member
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
'created'
get_latest_by
=
'created'
...
...
lms/djangoapps/commerce/api/v1/serializers.py
View file @
a0c25f88
...
@@ -31,7 +31,7 @@ class CourseModeSerializer(serializers.ModelSerializer):
...
@@ -31,7 +31,7 @@ class CourseModeSerializer(serializers.ModelSerializer):
except
AttributeError
:
except
AttributeError
:
return
None
return
None
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseMode
model
=
CourseMode
fields
=
(
'name'
,
'currency'
,
'price'
,
'sku'
,
'expires'
)
fields
=
(
'name'
,
'currency'
,
'price'
,
'sku'
,
'expires'
)
...
...
lms/djangoapps/courseware/models.py
View file @
a0c25f88
...
@@ -101,7 +101,7 @@ class StudentModule(CallStackMixin, models.Model):
...
@@ -101,7 +101,7 @@ class StudentModule(CallStackMixin, models.Model):
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
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'
),)
unique_together
=
((
'student'
,
'module_state_key'
,
'course_id'
),)
# Internal state of the object
# Internal state of the object
...
@@ -160,7 +160,7 @@ class StudentModuleHistory(CallStackMixin, models.Model):
...
@@ -160,7 +160,7 @@ class StudentModuleHistory(CallStackMixin, models.Model):
objects
=
CallStackManager
()
objects
=
CallStackManager
()
HISTORY_SAVING_TYPES
=
{
'problem'
}
HISTORY_SAVING_TYPES
=
{
'problem'
}
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
"created"
get_latest_by
=
"created"
student_module
=
models
.
ForeignKey
(
StudentModule
,
db_index
=
True
)
student_module
=
models
.
ForeignKey
(
StudentModule
,
db_index
=
True
)
...
@@ -195,7 +195,7 @@ class XBlockFieldBase(models.Model):
...
@@ -195,7 +195,7 @@ class XBlockFieldBase(models.Model):
"""
"""
objects
=
ChunkingManager
()
objects
=
ChunkingManager
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
abstract
=
True
abstract
=
True
# The name of the field
# The name of the field
...
@@ -222,7 +222,7 @@ class XModuleUserStateSummaryField(XBlockFieldBase):
...
@@ -222,7 +222,7 @@ class XModuleUserStateSummaryField(XBlockFieldBase):
"""
"""
Stores data set in the Scope.user_state_summary scope by an xmodule field
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'
),)
unique_together
=
((
'usage_id'
,
'field_name'
),)
# The definition id for the module
# The definition id for the module
...
@@ -233,7 +233,7 @@ class XModuleStudentPrefsField(XBlockFieldBase):
...
@@ -233,7 +233,7 @@ class XModuleStudentPrefsField(XBlockFieldBase):
"""
"""
Stores data set in the Scope.preferences scope by an xmodule field
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'
),)
unique_together
=
((
'student'
,
'module_type'
,
'field_name'
),)
# The type of the module for these preferences
# The type of the module for these preferences
...
@@ -246,8 +246,9 @@ class XModuleStudentInfoField(XBlockFieldBase):
...
@@ -246,8 +246,9 @@ class XModuleStudentInfoField(XBlockFieldBase):
"""
"""
Stores data set in the Scope.preferences scope by an xmodule field
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'
),)
unique_together
=
((
'student'
,
'field_name'
),)
student
=
models
.
ForeignKey
(
User
,
db_index
=
True
)
student
=
models
.
ForeignKey
(
User
,
db_index
=
True
)
...
@@ -263,7 +264,7 @@ class OfflineComputedGrade(models.Model):
...
@@ -263,7 +264,7 @@ class OfflineComputedGrade(models.Model):
gradeset
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
# grades, stored as JSON
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'
),
)
unique_together
=
((
'user'
,
'course_id'
),
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -275,7 +276,7 @@ class OfflineComputedGradeLog(models.Model):
...
@@ -275,7 +276,7 @@ class OfflineComputedGradeLog(models.Model):
Log of when offline grades are computed.
Log of when offline grades are computed.
Use this to be able to show instructor when the last computed grades were done.
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"
]
ordering
=
[
"-created"
]
get_latest_by
=
"created"
get_latest_by
=
"created"
...
@@ -298,7 +299,7 @@ class StudentFieldOverride(TimeStampedModel):
...
@@ -298,7 +299,7 @@ class StudentFieldOverride(TimeStampedModel):
location
=
LocationKeyField
(
max_length
=
255
,
db_index
=
True
)
location
=
LocationKeyField
(
max_length
=
255
,
db_index
=
True
)
student
=
models
.
ForeignKey
(
User
,
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'
),)
unique_together
=
((
'course_id'
,
'field'
,
'location'
,
'student'
),)
field
=
models
.
CharField
(
max_length
=
255
)
field
=
models
.
CharField
(
max_length
=
255
)
...
...
lms/djangoapps/django_comment_client/tests/factories.py
View file @
a0c25f88
...
@@ -3,13 +3,15 @@ from django_comment_common.models import Role, Permission
...
@@ -3,13 +3,15 @@ from django_comment_common.models import Role, Permission
class
RoleFactory
(
DjangoModelFactory
):
class
RoleFactory
(
DjangoModelFactory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
Role
model
=
Role
name
=
'Student'
name
=
'Student'
course_id
=
'edX/toy/2012_Fall'
course_id
=
'edX/toy/2012_Fall'
class
PermissionFactory
(
DjangoModelFactory
):
class
PermissionFactory
(
DjangoModelFactory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
Permission
model
=
Permission
name
=
'create_comment'
name
=
'create_comment'
lms/djangoapps/foldit/models.py
View file @
a0c25f88
...
@@ -83,7 +83,7 @@ class PuzzleComplete(models.Model):
...
@@ -83,7 +83,7 @@ class PuzzleComplete(models.Model):
e.g. PuzzleID 1234, set 1, subset 3. (Sets and subsets correspond to levels
e.g. PuzzleID 1234, set 1, subset 3. (Sets and subsets correspond to levels
in the intro puzzles)
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
# there should only be one puzzle complete entry for any particular
# puzzle for any user
# puzzle for any user
unique_together
=
(
'user'
,
'puzzle_id'
,
'puzzle_set'
,
'puzzle_subset'
)
unique_together
=
(
'user'
,
'puzzle_id'
,
'puzzle_set'
,
'puzzle_subset'
)
...
...
lms/djangoapps/instructor_task/tests/factories.py
View file @
a0c25f88
...
@@ -9,7 +9,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
...
@@ -9,7 +9,7 @@ from opaque_keys.edx.locations import SlashSeparatedCourseKey
class
InstructorTaskFactory
(
DjangoModelFactory
):
class
InstructorTaskFactory
(
DjangoModelFactory
):
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
InstructorTask
model
=
InstructorTask
task_type
=
'rescore_problem'
task_type
=
'rescore_problem'
...
...
lms/djangoapps/licenses/tests.py
View file @
a0c25f88
...
@@ -32,7 +32,7 @@ log = logging.getLogger(__name__)
...
@@ -32,7 +32,7 @@ log = logging.getLogger(__name__)
class
CourseSoftwareFactory
(
DjangoModelFactory
):
class
CourseSoftwareFactory
(
DjangoModelFactory
):
'''Factory for generating CourseSoftware objects in database'''
'''Factory for generating CourseSoftware objects in database'''
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseSoftware
model
=
CourseSoftware
name
=
SOFTWARE_1
name
=
SOFTWARE_1
...
@@ -48,7 +48,7 @@ class UserLicenseFactory(DjangoModelFactory):
...
@@ -48,7 +48,7 @@ class UserLicenseFactory(DjangoModelFactory):
By default, the user assigned is null, indicating that the
By default, the user assigned is null, indicating that the
serial number has not yet been assigned.
serial number has not yet been assigned.
'''
'''
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
UserLicense
model
=
UserLicense
user
=
None
user
=
None
...
...
lms/djangoapps/lti_provider/models.py
View file @
a0c25f88
...
@@ -117,9 +117,6 @@ class GradedAssignment(models.Model):
...
@@ -117,9 +117,6 @@ class GradedAssignment(models.Model):
version_number
=
models
.
IntegerField
(
default
=
0
)
version_number
=
models
.
IntegerField
(
default
=
0
)
class
Meta
(
object
):
class
Meta
(
object
):
"""
Uniqueness constraints.
"""
unique_together
=
(
'outcome_service'
,
'lis_result_sourcedid'
)
unique_together
=
(
'outcome_service'
,
'lis_result_sourcedid'
)
...
@@ -135,7 +132,4 @@ class LtiUser(models.Model):
...
@@ -135,7 +132,4 @@ class LtiUser(models.Model):
edx_user
=
models
.
ForeignKey
(
User
,
unique
=
True
)
edx_user
=
models
.
ForeignKey
(
User
,
unique
=
True
)
class
Meta
(
object
):
class
Meta
(
object
):
"""
Uniqueness constraints.
"""
unique_together
=
(
'lti_consumer'
,
'lti_user_id'
)
unique_together
=
(
'lti_consumer'
,
'lti_user_id'
)
lms/djangoapps/mobile_api/users/serializers.py
View file @
a0c25f88
...
@@ -97,7 +97,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer):
...
@@ -97,7 +97,7 @@ class CourseEnrollmentSerializer(serializers.ModelSerializer):
else
:
else
:
return
{}
return
{}
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseEnrollment
model
=
CourseEnrollment
fields
=
(
'created'
,
'mode'
,
'is_active'
,
'course'
,
'certificate'
)
fields
=
(
'created'
,
'mode'
,
'is_active'
,
'course'
,
'certificate'
)
lookup_field
=
'username'
lookup_field
=
'username'
...
@@ -113,7 +113,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
...
@@ -113,7 +113,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
lookup_field
=
'username'
lookup_field
=
'username'
)
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
User
model
=
User
fields
=
(
'id'
,
'username'
,
'email'
,
'name'
,
'course_enrollments'
)
fields
=
(
'id'
,
'username'
,
'email'
,
'name'
,
'course_enrollments'
)
lookup_field
=
'username'
lookup_field
=
'username'
lms/djangoapps/notifier_api/serializers.py
View file @
a0c25f88
...
@@ -63,7 +63,7 @@ class NotifierUserSerializer(serializers.ModelSerializer):
...
@@ -63,7 +63,7 @@ class NotifierUserSerializer(serializers.ModelSerializer):
pass
pass
return
ret
return
ret
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
User
model
=
User
fields
=
(
"id"
,
"email"
,
"name"
,
"preferences"
,
"course_info"
)
fields
=
(
"id"
,
"email"
,
"name"
,
"preferences"
,
"course_info"
)
read_only_fields
=
(
"id"
,
"email"
)
read_only_fields
=
(
"id"
,
"email"
)
lms/djangoapps/shoppingcart/models.py
View file @
a0c25f88
...
@@ -1164,7 +1164,7 @@ class InvoiceHistory(models.Model):
...
@@ -1164,7 +1164,7 @@ class InvoiceHistory(models.Model):
elif
hasattr
(
instance
,
'invoice'
):
elif
hasattr
(
instance
,
'invoice'
):
InvoiceHistory
.
save_invoice_snapshot
(
instance
.
invoice
)
InvoiceHistory
.
save_invoice_snapshot
(
instance
.
invoice
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
get_latest_by
=
"timestamp"
get_latest_by
=
"timestamp"
...
...
lms/djangoapps/survey/admin.py
View file @
a0c25f88
...
@@ -10,7 +10,7 @@ from survey.models import SurveyForm
...
@@ -10,7 +10,7 @@ from survey.models import SurveyForm
class
SurveyFormAdminForm
(
forms
.
ModelForm
):
class
SurveyFormAdminForm
(
forms
.
ModelForm
):
"""Form providing validation of SurveyForm content."""
"""Form providing validation of SurveyForm content."""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
SurveyForm
model
=
SurveyForm
fields
=
(
'name'
,
'form'
)
fields
=
(
'name'
,
'form'
)
...
...
lms/djangoapps/teams/models.py
View file @
a0c25f88
...
@@ -154,7 +154,6 @@ class CourseTeamMembership(models.Model):
...
@@ -154,7 +154,6 @@ class CourseTeamMembership(models.Model):
"""This model represents the membership of a single user in a single team."""
"""This model represents the membership of a single user in a single team."""
class
Meta
(
object
):
class
Meta
(
object
):
"""Stores meta information for the model."""
unique_together
=
((
'user'
,
'team'
),)
unique_together
=
((
'user'
,
'team'
),)
user
=
models
.
ForeignKey
(
User
)
user
=
models
.
ForeignKey
(
User
)
...
...
lms/djangoapps/teams/serializers.py
View file @
a0c25f88
...
@@ -62,7 +62,6 @@ class UserMembershipSerializer(serializers.ModelSerializer):
...
@@ -62,7 +62,6 @@ class UserMembershipSerializer(serializers.ModelSerializer):
)
)
class
Meta
(
object
):
class
Meta
(
object
):
"""Defines meta information for the ModelSerializer."""
model
=
CourseTeamMembership
model
=
CourseTeamMembership
fields
=
(
"user"
,
"date_joined"
,
"last_activity_at"
)
fields
=
(
"user"
,
"date_joined"
,
"last_activity_at"
)
read_only_fields
=
(
"date_joined"
,
"last_activity_at"
)
read_only_fields
=
(
"date_joined"
,
"last_activity_at"
)
...
@@ -75,7 +74,6 @@ class CourseTeamSerializer(serializers.ModelSerializer):
...
@@ -75,7 +74,6 @@ class CourseTeamSerializer(serializers.ModelSerializer):
country
=
CountryField
()
country
=
CountryField
()
class
Meta
(
object
):
class
Meta
(
object
):
"""Defines meta information for the ModelSerializer."""
model
=
CourseTeam
model
=
CourseTeam
fields
=
(
fields
=
(
"id"
,
"id"
,
...
@@ -99,7 +97,6 @@ class CourseTeamCreationSerializer(serializers.ModelSerializer):
...
@@ -99,7 +97,6 @@ class CourseTeamCreationSerializer(serializers.ModelSerializer):
country
=
CountryField
(
required
=
False
)
country
=
CountryField
(
required
=
False
)
class
Meta
(
object
):
class
Meta
(
object
):
"""Defines meta information for the ModelSerializer."""
model
=
CourseTeam
model
=
CourseTeam
fields
=
(
fields
=
(
"name"
,
"name"
,
...
@@ -161,7 +158,6 @@ class MembershipSerializer(serializers.ModelSerializer):
...
@@ -161,7 +158,6 @@ class MembershipSerializer(serializers.ModelSerializer):
)
)
class
Meta
(
object
):
class
Meta
(
object
):
"""Defines meta information for the ModelSerializer."""
model
=
CourseTeamMembership
model
=
CourseTeamMembership
fields
=
(
"user"
,
"team"
,
"date_joined"
,
"last_activity_at"
)
fields
=
(
"user"
,
"team"
,
"date_joined"
,
"last_activity_at"
)
read_only_fields
=
(
"date_joined"
,
"last_activity_at"
)
read_only_fields
=
(
"date_joined"
,
"last_activity_at"
)
...
@@ -209,7 +205,7 @@ class BulkTeamCountTopicSerializer(BaseTopicSerializer): # pylint: disable=abst
...
@@ -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.
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.
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
list_serializer_class
=
BulkTeamCountTopicListSerializer
...
...
lms/djangoapps/teams/tests/factories.py
View file @
a0c25f88
...
@@ -18,7 +18,7 @@ class CourseTeamFactory(DjangoModelFactory):
...
@@ -18,7 +18,7 @@ class CourseTeamFactory(DjangoModelFactory):
Note that team_id is not auto-generated from name when using the factory.
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
model
=
CourseTeam
django_get_or_create
=
(
'team_id'
,)
django_get_or_create
=
(
'team_id'
,)
...
@@ -31,8 +31,9 @@ class CourseTeamFactory(DjangoModelFactory):
...
@@ -31,8 +31,9 @@ class CourseTeamFactory(DjangoModelFactory):
class
CourseTeamMembershipFactory
(
DjangoModelFactory
):
class
CourseTeamMembershipFactory
(
DjangoModelFactory
):
"""Factory for CourseTeamMemberships."""
"""Factory for CourseTeamMemberships."""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseTeamMembership
model
=
CourseTeamMembership
last_activity_at
=
LAST_ACTIVITY_AT
last_activity_at
=
LAST_ACTIVITY_AT
@classmethod
@classmethod
...
...
lms/djangoapps/verify_student/models.py
View file @
a0c25f88
...
@@ -188,7 +188,7 @@ class PhotoVerification(StatusModel):
...
@@ -188,7 +188,7 @@ class PhotoVerification(StatusModel):
# capturing it so that we can later query for the common problems.
# capturing it so that we can later query for the common problems.
error_code
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
)
error_code
=
models
.
CharField
(
blank
=
True
,
max_length
=
50
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
abstract
=
True
abstract
=
True
ordering
=
[
'-created_at'
]
ordering
=
[
'-created_at'
]
...
@@ -1043,7 +1043,7 @@ class VerificationCheckpoint(models.Model):
...
@@ -1043,7 +1043,7 @@ class VerificationCheckpoint(models.Model):
checkpoint_location
=
models
.
CharField
(
max_length
=
255
)
checkpoint_location
=
models
.
CharField
(
max_length
=
255
)
photo_verification
=
models
.
ManyToManyField
(
SoftwareSecurePhotoVerification
)
photo_verification
=
models
.
ManyToManyField
(
SoftwareSecurePhotoVerification
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
(
'course_id'
,
'checkpoint_location'
)
unique_together
=
(
'course_id'
,
'checkpoint_location'
)
def
__unicode__
(
self
):
def
__unicode__
(
self
):
...
@@ -1152,7 +1152,7 @@ class VerificationStatus(models.Model):
...
@@ -1152,7 +1152,7 @@ class VerificationStatus(models.Model):
response
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
response
=
models
.
TextField
(
null
=
True
,
blank
=
True
)
error
=
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"
get_latest_by
=
"timestamp"
verbose_name
=
"Verification Status"
verbose_name
=
"Verification Status"
verbose_name_plural
=
"Verification Statuses"
verbose_name_plural
=
"Verification Statuses"
...
@@ -1329,7 +1329,7 @@ class SkippedReverification(models.Model):
...
@@ -1329,7 +1329,7 @@ class SkippedReverification(models.Model):
checkpoint
=
models
.
ForeignKey
(
VerificationCheckpoint
,
related_name
=
"skipped_checkpoint"
)
checkpoint
=
models
.
ForeignKey
(
VerificationCheckpoint
,
related_name
=
"skipped_checkpoint"
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
((
'user'
,
'course_id'
),)
unique_together
=
((
'user'
,
'course_id'
),)
@classmethod
@classmethod
...
...
lms/djangoapps/verify_student/tests/factories.py
View file @
a0c25f88
...
@@ -10,7 +10,7 @@ class SoftwareSecurePhotoVerificationFactory(DjangoModelFactory):
...
@@ -10,7 +10,7 @@ class SoftwareSecurePhotoVerificationFactory(DjangoModelFactory):
"""
"""
Factory for SoftwareSecurePhotoVerification
Factory for SoftwareSecurePhotoVerification
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
SoftwareSecurePhotoVerification
model
=
SoftwareSecurePhotoVerification
status
=
'approved'
status
=
'approved'
openedx/core/djangoapps/course_groups/models.py
View file @
a0c25f88
...
@@ -18,7 +18,7 @@ class CourseUserGroup(models.Model):
...
@@ -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
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.
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'
),
)
unique_together
=
((
'name'
,
'course_id'
),
)
name
=
models
.
CharField
(
max_length
=
255
,
name
=
models
.
CharField
(
max_length
=
255
,
...
...
openedx/core/djangoapps/course_groups/tests/helpers.py
View file @
a0c25f88
...
@@ -18,7 +18,7 @@ class CohortFactory(DjangoModelFactory):
...
@@ -18,7 +18,7 @@ class CohortFactory(DjangoModelFactory):
"""
"""
Factory for constructing mock cohorts.
Factory for constructing mock cohorts.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseUserGroup
model
=
CourseUserGroup
name
=
Sequence
(
"cohort{}"
.
format
)
name
=
Sequence
(
"cohort{}"
.
format
)
...
@@ -38,7 +38,7 @@ class CourseCohortFactory(DjangoModelFactory):
...
@@ -38,7 +38,7 @@ class CourseCohortFactory(DjangoModelFactory):
"""
"""
Factory for constructing mock course cohort.
Factory for constructing mock course cohort.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseCohort
model
=
CourseCohort
course_user_group
=
factory
.
SubFactory
(
CohortFactory
)
course_user_group
=
factory
.
SubFactory
(
CohortFactory
)
...
@@ -49,7 +49,7 @@ class CourseCohortSettingsFactory(DjangoModelFactory):
...
@@ -49,7 +49,7 @@ class CourseCohortSettingsFactory(DjangoModelFactory):
"""
"""
Factory for constructing mock course cohort settings.
Factory for constructing mock course cohort settings.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CourseCohortsSettings
model
=
CourseCohortsSettings
is_cohorted
=
False
is_cohorted
=
False
...
...
openedx/core/djangoapps/credit/admin.py
View file @
a0c25f88
...
@@ -13,7 +13,7 @@ class CreditCourseAdmin(admin.ModelAdmin):
...
@@ -13,7 +13,7 @@ class CreditCourseAdmin(admin.ModelAdmin):
list_filter
=
(
'enabled'
,)
list_filter
=
(
'enabled'
,)
search_fields
=
(
'course_key'
,)
search_fields
=
(
'course_key'
,)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CreditCourse
model
=
CreditCourse
...
@@ -23,7 +23,7 @@ class CreditProviderAdmin(admin.ModelAdmin):
...
@@ -23,7 +23,7 @@ class CreditProviderAdmin(admin.ModelAdmin):
list_filter
=
(
'active'
,)
list_filter
=
(
'active'
,)
search_fields
=
(
'provider_id'
,
'display_name'
)
search_fields
=
(
'provider_id'
,
'display_name'
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CreditProvider
model
=
CreditProvider
...
@@ -32,7 +32,7 @@ class CreditEligibilityAdmin(admin.ModelAdmin):
...
@@ -32,7 +32,7 @@ class CreditEligibilityAdmin(admin.ModelAdmin):
list_display
=
(
'course'
,
'username'
,
'deadline'
)
list_display
=
(
'course'
,
'username'
,
'deadline'
)
search_fields
=
(
'username'
,
'course__course_key'
)
search_fields
=
(
'username'
,
'course__course_key'
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CreditEligibility
model
=
CreditEligibility
...
@@ -43,7 +43,7 @@ class CreditRequestAdmin(admin.ModelAdmin):
...
@@ -43,7 +43,7 @@ class CreditRequestAdmin(admin.ModelAdmin):
readonly_fields
=
(
'uuid'
,)
readonly_fields
=
(
'uuid'
,)
search_fields
=
(
'uuid'
,
'username'
,
'course__course_key'
,
'provider__provider_id'
)
search_fields
=
(
'uuid'
,
'username'
,
'course__course_key'
,
'provider__provider_id'
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CreditRequest
model
=
CreditRequest
...
...
openedx/core/djangoapps/credit/models.py
View file @
a0c25f88
...
@@ -291,9 +291,6 @@ class CreditRequirement(TimeStampedModel):
...
@@ -291,9 +291,6 @@ class CreditRequirement(TimeStampedModel):
active
=
models
.
BooleanField
(
default
=
True
)
active
=
models
.
BooleanField
(
default
=
True
)
class
Meta
(
object
):
class
Meta
(
object
):
"""
Model metadata.
"""
unique_together
=
(
'namespace'
,
'name'
,
'course'
)
unique_together
=
(
'namespace'
,
'name'
,
'course'
)
ordering
=
[
"order"
]
ordering
=
[
"order"
]
...
@@ -428,7 +425,7 @@ class CreditRequirementStatus(TimeStampedModel):
...
@@ -428,7 +425,7 @@ class CreditRequirementStatus(TimeStampedModel):
# Maintain a history of requirement status updates for auditing purposes
# Maintain a history of requirement status updates for auditing purposes
history
=
HistoricalRecords
()
history
=
HistoricalRecords
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
(
'username'
,
'requirement'
)
unique_together
=
(
'username'
,
'requirement'
)
@classmethod
@classmethod
...
@@ -515,7 +512,7 @@ class CreditEligibility(TimeStampedModel):
...
@@ -515,7 +512,7 @@ class CreditEligibility(TimeStampedModel):
help_text
=
ugettext_lazy
(
"Deadline for purchasing and requesting credit."
)
help_text
=
ugettext_lazy
(
"Deadline for purchasing and requesting credit."
)
)
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
(
'username'
,
'course'
)
unique_together
=
(
'username'
,
'course'
)
verbose_name_plural
=
"Credit eligibilities"
verbose_name_plural
=
"Credit eligibilities"
...
@@ -637,7 +634,7 @@ class CreditRequest(TimeStampedModel):
...
@@ -637,7 +634,7 @@ class CreditRequest(TimeStampedModel):
history
=
HistoricalRecords
()
history
=
HistoricalRecords
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
# Enforce the constraint that each user can have exactly one outstanding
# Enforce the constraint that each user can have exactly one outstanding
# request to a given provider. Multiple requests use the same UUID.
# request to a given provider. Multiple requests use the same UUID.
unique_together
=
(
'username'
,
'course'
,
'provider'
)
unique_together
=
(
'username'
,
'course'
,
'provider'
)
...
...
openedx/core/djangoapps/credit/serializers.py
View file @
a0c25f88
...
@@ -29,6 +29,6 @@ class CreditCourseSerializer(serializers.ModelSerializer):
...
@@ -29,6 +29,6 @@ class CreditCourseSerializer(serializers.ModelSerializer):
course_key
=
CourseKeyField
()
course_key
=
CourseKeyField
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
CreditCourse
model
=
CreditCourse
exclude
=
(
'id'
,)
exclude
=
(
'id'
,)
openedx/core/djangoapps/user_api/accounts/serializers.py
View file @
a0c25f88
...
@@ -24,7 +24,7 @@ class LanguageProficiencySerializer(serializers.ModelSerializer):
...
@@ -24,7 +24,7 @@ class LanguageProficiencySerializer(serializers.ModelSerializer):
Class that serializes the LanguageProficiency model for account
Class that serializes the LanguageProficiency model for account
information.
information.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
LanguageProficiency
model
=
LanguageProficiency
fields
=
(
"code"
,)
fields
=
(
"code"
,)
...
@@ -144,7 +144,7 @@ class AccountUserSerializer(serializers.HyperlinkedModelSerializer, ReadOnlyFiel
...
@@ -144,7 +144,7 @@ class AccountUserSerializer(serializers.HyperlinkedModelSerializer, ReadOnlyFiel
"""
"""
Class that serializes the portion of User model needed for account information.
Class that serializes the portion of User model needed for account information.
"""
"""
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
User
model
=
User
fields
=
(
"username"
,
"email"
,
"date_joined"
,
"is_active"
)
fields
=
(
"username"
,
"email"
,
"date_joined"
,
"is_active"
)
read_only_fields
=
(
"username"
,
"email"
,
"date_joined"
,
"is_active"
)
read_only_fields
=
(
"username"
,
"email"
,
"date_joined"
,
"is_active"
)
...
@@ -159,7 +159,7 @@ class AccountLegacyProfileSerializer(serializers.HyperlinkedModelSerializer, Rea
...
@@ -159,7 +159,7 @@ class AccountLegacyProfileSerializer(serializers.HyperlinkedModelSerializer, Rea
requires_parental_consent
=
serializers
.
SerializerMethodField
()
requires_parental_consent
=
serializers
.
SerializerMethodField
()
language_proficiencies
=
LanguageProficiencySerializer
(
many
=
True
,
required
=
False
)
language_proficiencies
=
LanguageProficiencySerializer
(
many
=
True
,
required
=
False
)
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
UserProfile
model
=
UserProfile
fields
=
(
fields
=
(
"name"
,
"gender"
,
"goals"
,
"year_of_birth"
,
"level_of_education"
,
"country"
,
"name"
,
"gender"
,
"goals"
,
"year_of_birth"
,
"level_of_education"
,
"country"
,
...
...
openedx/core/djangoapps/user_api/models.py
View file @
a0c25f88
...
@@ -27,7 +27,7 @@ class UserPreference(models.Model):
...
@@ -27,7 +27,7 @@ class UserPreference(models.Model):
key
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
,
validators
=
[
RegexValidator
(
KEY_REGEX
)])
key
=
models
.
CharField
(
max_length
=
255
,
db_index
=
True
,
validators
=
[
RegexValidator
(
KEY_REGEX
)])
value
=
models
.
TextField
()
value
=
models
.
TextField
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
(
"user"
,
"key"
)
unique_together
=
(
"user"
,
"key"
)
@classmethod
@classmethod
...
@@ -96,7 +96,7 @@ class UserCourseTag(models.Model):
...
@@ -96,7 +96,7 @@ class UserCourseTag(models.Model):
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
course_id
=
CourseKeyField
(
max_length
=
255
,
db_index
=
True
)
value
=
models
.
TextField
()
value
=
models
.
TextField
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
unique_together
=
(
"user"
,
"course_id"
,
"key"
)
unique_together
=
(
"user"
,
"course_id"
,
"key"
)
...
@@ -112,5 +112,4 @@ class UserOrgTag(TimeStampedModel):
...
@@ -112,5 +112,4 @@ class UserOrgTag(TimeStampedModel):
value
=
models
.
TextField
()
value
=
models
.
TextField
()
class
Meta
(
object
):
class
Meta
(
object
):
""" Meta class for defining unique constraints. """
unique_together
=
(
"user"
,
"org"
,
"key"
)
unique_together
=
(
"user"
,
"org"
,
"key"
)
openedx/core/djangoapps/user_api/serializers.py
View file @
a0c25f88
...
@@ -28,7 +28,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
...
@@ -28,7 +28,7 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
"""
"""
return
dict
([(
pref
.
key
,
pref
.
value
)
for
pref
in
user
.
preferences
.
all
()])
return
dict
([(
pref
.
key
,
pref
.
value
)
for
pref
in
user
.
preferences
.
all
()])
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
User
model
=
User
# This list is the minimal set required by the notification service
# This list is the minimal set required by the notification service
fields
=
(
"id"
,
"url"
,
"email"
,
"name"
,
"username"
,
"preferences"
)
fields
=
(
"id"
,
"url"
,
"email"
,
"name"
,
"username"
,
"preferences"
)
...
@@ -41,7 +41,7 @@ class UserPreferenceSerializer(serializers.HyperlinkedModelSerializer):
...
@@ -41,7 +41,7 @@ class UserPreferenceSerializer(serializers.HyperlinkedModelSerializer):
"""
"""
user
=
UserSerializer
()
user
=
UserSerializer
()
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
UserPreference
model
=
UserPreference
depth
=
1
depth
=
1
...
@@ -52,7 +52,7 @@ class RawUserPreferenceSerializer(serializers.ModelSerializer):
...
@@ -52,7 +52,7 @@ class RawUserPreferenceSerializer(serializers.ModelSerializer):
"""
"""
user
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
User
.
objects
.
all
())
user
=
serializers
.
PrimaryKeyRelatedField
(
queryset
=
User
.
objects
.
all
())
class
Meta
(
object
):
# pylint: disable=missing-docstring
class
Meta
(
object
):
model
=
UserPreference
model
=
UserPreference
depth
=
1
depth
=
1
...
...
openedx/core/lib/api/serializers.py
View file @
a0c25f88
...
@@ -36,8 +36,4 @@ class CollapsedReferenceSerializer(serializers.HyperlinkedModelSerializer):
...
@@ -36,8 +36,4 @@ class CollapsedReferenceSerializer(serializers.HyperlinkedModelSerializer):
self
.
fields
[
'url'
]
.
lookup_url_kwarg
=
lookup_field
self
.
fields
[
'url'
]
.
lookup_url_kwarg
=
lookup_field
class
Meta
(
object
):
class
Meta
(
object
):
"""Defines meta information for the ModelSerializer.
model is set dynamically in __init__.
"""
fields
=
(
"url"
,)
fields
=
(
"url"
,)
pylintrc
View file @
a0c25f88
...
@@ -73,7 +73,7 @@ class-attribute-rgx = ([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
...
@@ -73,7 +73,7 @@ class-attribute-rgx = ([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$
inlinevar-rgx = [A-Za-z_][A-Za-z0-9_]*$
good-names = f,i,j,k,db,ex,Run,_,__
good-names = f,i,j,k,db,ex,Run,_,__
bad-names = foo,bar,baz,toto,tutu,tata
bad-names = foo,bar,baz,toto,tutu,tata
no-docstring-rgx = __.*__
|test_.+|setUp|tearDown
no-docstring-rgx = __.*__
$|test_.+|setUp$|setUpClass$|tearDown$|tearDownClass$|Meta$
docstring-min-length = -1
docstring-min-length = -1
[FORMAT]
[FORMAT]
...
@@ -152,4 +152,4 @@ int-import-graph =
...
@@ -152,4 +152,4 @@ int-import-graph =
[EXCEPTIONS]
[EXCEPTIONS]
overgeneral-exceptions = Exception
overgeneral-exceptions = Exception
#
6a610602e4c093047ed189c9a0d4ba796c7d1622
#
503c3db797ee662a18237a57f00cb1e6e553be34
requirements/edx/github.txt
View file @
a0c25f88
...
@@ -50,7 +50,7 @@ git+https://github.com/edx/edx-oauth2-provider.git@0.5.7#egg=oauth2-provider==0.
...
@@ -50,7 +50,7 @@ git+https://github.com/edx/edx-oauth2-provider.git@0.5.7#egg=oauth2-provider==0.
-e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock
-e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock
-e git+https://github.com/edx/edx-search.git@release-2015-09-11a#egg=edx-search
-e git+https://github.com/edx/edx-search.git@release-2015-09-11a#egg=edx-search
git+https://github.com/edx/edx-milestones.git@release-2015-10-20#egg=edx-milestones==0.1.3
git+https://github.com/edx/edx-milestones.git@release-2015-10-20#egg=edx-milestones==0.1.3
git+https://github.com/edx/edx-lint.git@v0.
2.9#egg=edx_lint==0.2.9
git+https://github.com/edx/edx-lint.git@v0.
3.0#egg=edx_lint==0.3.0
-e git+https://github.com/edx/xblock-utils.git@213a97a50276d6a2504d8133650b2930ead357a0#egg=xblock-utils
-e git+https://github.com/edx/xblock-utils.git@213a97a50276d6a2504d8133650b2930ead357a0#egg=xblock-utils
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
git+https://github.com/edx/edx-reverification-block.git@0.0.4#egg=edx-reverification-block==0.0.4
git+https://github.com/edx/edx-reverification-block.git@0.0.4#egg=edx-reverification-block==0.0.4
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment