Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Save organisation transcript preferences - EDUCATOR-1048 #14

Conversation

mushtaqak
Copy link
Contributor

@mushtaqak mushtaqak commented Aug 1, 2017

The purpose of this PR is to save organisation transcript preferences and show in admin side.

EDUCATOR-1048

@mushtaqak mushtaqak force-pushed the mushtaq/save-org-transcript-prefs branch from 163e8c0 to c5e1ad1 Compare August 1, 2017 14:16
"""
Model to contain third party transcription service provider preferances.
"""
org = models.CharField('Organization', max_length=50, unique=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add help text to tell others that these are organizations from studio / platform, not the institutes in VEDA.

api_key = models.CharField('API key', max_length=255)
api_secret = models.CharField('API secret', max_length=255, null=True, blank=True)
created = models.DateTimeField(auto_now_add=True, null=True)
modified = models.DateTimeField(auto_now=True, null=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use timestamped model which includes these fields by default ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

timestamped is not available in this repo. we can either add in or just go with these 2 fields for now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add Django model utils to use timestamped model.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

Model to contain third party transcription service provider preferances.
"""
org = models.CharField('Organization', max_length=50, unique=True)
provider = models.CharField('Transcription provider', max_length=50, choices=TranscriptionProviderType.CHOICES)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mushtaqak I think we need to make org & provider unique in a combination. So that orgs can have both credentials to use them in different courses.

modified = models.DateTimeField(auto_now=True, null=True)

def __unicode__(self):
return self.org

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add org & provider as unicode. Also, can we make this real unicode.

)


class TranscriptionProvider(models.Model):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we name it TranscriptionPreferences ?

@muzaffaryousaf
Copy link

@yro I can't see migration in edx-video-pipeline, is it by intention ??? Also, how they work on production ?

@@ -137,6 +137,7 @@
'rest_framework.authtoken',
'oauth2_provider',
'rest_framework',
'django_filters',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to reviewers: This is added to resolve TemplateNotExist error when accessing rest api views.

See https://github.com/edx/credentials/pull/284/files and carltongibson/django-filter#562

@yro
Copy link
Contributor

yro commented Aug 2, 2017

@mushtaqak We don't have a migration folder yet. I'll do the migrations (via manage.py) for this on deploy and check the folder back into the repo for future use. Good catch!

Copy link

@muzaffaryousaf muzaffaryousaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@muzaffaryousaf
Copy link

@yro Do you think we should merge the changes related to models in master branch without migrations. I'm not sure just because of migrations on prod and how they'll work.

@yro
Copy link
Contributor

yro commented Aug 4, 2017

@muzaffaryousaf yes you should merge without migrations just this one time. After I push this PR to prod, I'll pull the migrations back into the repo, and future changes to models/migrations can be made in the repo.

)

class Meta:
unique_together = ('video', 'provider', 'lang_code')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: we need to remove this constraint, this will raise integrity in case of VEDA heal (i.e. transcription re-process for same lang)

@muzaffaryousaf muzaffaryousaf changed the base branch from master to transcripts-3rd-party-integration August 9, 2017 13:40
@muzaffaryousaf muzaffaryousaf force-pushed the mushtaq/save-org-transcript-prefs branch from 3b2cdb5 to 2cc7eab Compare August 9, 2017 13:44
@muzaffaryousaf muzaffaryousaf merged this pull request into transcripts-3rd-party-integration Aug 9, 2017
@muzaffaryousaf muzaffaryousaf deleted the mushtaq/save-org-transcript-prefs branch August 9, 2017 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants