forked from edx/edx-solutions-edx-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added model and API endpoints for experiment-scoped data
- Loading branch information
Showing
9 changed files
with
194 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
import django_filters | ||
|
||
from experiments.models import ExperimentData | ||
from experiments.models import ExperimentData, ExperimentKeyValue | ||
|
||
|
||
class ExperimentDataFilter(django_filters.FilterSet): | ||
class Meta(object): | ||
model = ExperimentData | ||
fields = ['experiment_id', 'key', ] | ||
|
||
|
||
class ExperimentKeyValueFilter(django_filters.FilterSet): | ||
class Meta(object): | ||
model = ExperimentKeyValue | ||
fields = ['experiment_id', 'key', ] |
34 changes: 34 additions & 0 deletions
34
lms/djangoapps/experiments/migrations/0002_auto_20170627_1402.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django_extensions.db.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('experiments', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ExperimentKeyValue', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')), | ||
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')), | ||
('experiment_id', models.PositiveSmallIntegerField(verbose_name=b'Experiment ID', db_index=True)), | ||
('key', models.CharField(max_length=255)), | ||
('value', models.TextField()), | ||
], | ||
options={ | ||
'verbose_name': 'Experiment Data', | ||
'verbose_name_plural': 'Experiment Data', | ||
}, | ||
), | ||
migrations.AlterUniqueTogether( | ||
name='experimentkeyvalue', | ||
unique_together=set([('experiment_id', 'key')]), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters