Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,13 @@ coverage.xml

# Django stuff:
*.log
*.sqlite3

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# virtualenv
venv
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
## Kolibri

Django app for the Content Curation project.

### Getting the codebase and configuring your git path

* [Fork the repo](https://github.com/fle-internal/content-curation) to your own remote github repository first

* Then, clone the repository into your local files

`git clone https://github.com/fle-internal/content-curation.git`

* Type in `git remote -v` to check what origin and upstream are tracking. Make sure origin refers to your remote repository, `yourusername/content-curation.git` and upstream refers to `fle-internal/content-curation.git`.
If not, use these commands:

Tracking upstream:

`git remote add upstream git@github.com:fle-internal/content-curation.git`
`git remote set-url upstream git@github.com:fle-internal/content-curation.git`

Tracking origin:

`git remote set-url origin git@github.com:yourusername/content-curation.git`

### Setting up your environment

* [Download Python 2.7.10](https://www.python.org/downloads/) if you don't have it already.

* [Install pip](https://pypi.python.org/pypi/pip) if you don't have it already.

* Set up your virtual environment

`pip install virtualenv` Installs your virtual environment

`virtualenv yourfoldername` Creates a folder for your virtual environment

`source yourfoldername/scripts/activate` Activates your virtual environment

IMPORTANT: Make sure you have done the above steps and are inside your virtual environment before continuing on.

`pip install -r requirements.txt` Installs python dependencies within your virtual environment

* Set up the database

`cd contentcuration`
`python manage.py makemigrations`
`python manage.py migrate`

* Run your server and start developing! Make sure you're in your virtual environment each time before you run the server.

`python manage.py runserver`

Visit the localhost link that is presented on your console.

### Adding files, committing, and pushing to your local repo:

When you're ready to submit your work, make sure you are not in your virtual environment.
Type in `deactivate` to exit your virtual environment.

Then:

`git add .`
`git commit -m "message that says what your code accomplished"`
`git push origin yourbranch`

And visit the [pull request page](https://github.com/fle-internal/fle-home/pulls) to get your code in!
Empty file.
103 changes: 103 additions & 0 deletions contentcuration/contentcuration/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings
import mptt.fields


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name='ContentLicense',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text="Name of license, e.g. 'Creative Commons Share-Alike 2.0'", max_length=255, verbose_name='name')),
],
),
migrations.CreateModel(
name='Node',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('created', models.DateTimeField(auto_now_add=True, verbose_name='created')),
('modified', models.DateTimeField(auto_now=True, verbose_name='modified')),
('name', models.CharField(help_text='Name of node to be displayed to the user in the menu', max_length=50, verbose_name='name')),
('published', models.BooleanField(default=False, help_text='If published, students can access this item', verbose_name='Published')),
('deleted', models.BooleanField(default=False, help_text='Indicates that the node has been deleted, and should only be retrievable through the admin backend', verbose_name='Deleted')),
('sort_order', models.FloatField(default=0, help_text='Ascending, lowest number shown first', unique=True, max_length=50, verbose_name='sort order')),
('lft', models.PositiveIntegerField(editable=False, db_index=True)),
('rght', models.PositiveIntegerField(editable=False, db_index=True)),
('tree_id', models.PositiveIntegerField(editable=False, db_index=True)),
('level', models.PositiveIntegerField(editable=False, db_index=True)),
],
options={
'verbose_name': 'Topic',
'verbose_name_plural': 'Topics',
},
),
migrations.CreateModel(
name='TopicTree',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('name', models.CharField(help_text='Displayed to the user', max_length=255, verbose_name='channel name')),
('lft', models.PositiveIntegerField(editable=False, db_index=True)),
('rght', models.PositiveIntegerField(editable=False, db_index=True)),
('tree_id', models.PositiveIntegerField(editable=False, db_index=True)),
('level', models.PositiveIntegerField(editable=False, db_index=True)),
('editors', models.ManyToManyField(help_text='Users with edit rights', to=settings.AUTH_USER_MODEL, verbose_name='editors')),
],
options={
'verbose_name': 'Topic tree',
'verbose_name_plural': 'Topic trees',
},
),
migrations.CreateModel(
name='ContentNode',
fields=[
('node_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='contentcuration.Node')),
('author', models.CharField(help_text='Name of the author(s) of book/movie/exercise', max_length=255)),
('license_owner', models.CharField(help_text='Organization of person who holds the essential rights', max_length=255, null=True, blank=True)),
('published_on', models.DateField(help_text='If applicable, state when this work was first published (not on this platform, but for its original publication).', null=True, blank=True)),
('retrieved_on', models.DateTimeField(help_text='Should be automatically filled in when an item is downloaded from its source of origin, either manually by user or automatically by script.', null=True, verbose_name='downloaded on', blank=True)),
('content_file', models.FileField(help_text='Upload video here', null=True, upload_to=b'', blank=True)),
('thumbnail', models.ImageField(help_text='Automatically created when new video is uploaded', null=True, upload_to=b'contents/video/thumbnails/', blank=True)),
('license', models.ForeignKey(verbose_name='license', to='contentcuration.ContentLicense', help_text='License under which the work is distributed')),
],
options={
'abstract': False,
},
bases=('contentcuration.node',),
),
migrations.CreateModel(
name='TopicNode',
fields=[
('node_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='contentcuration.Node')),
('color1', models.CharField(max_length=7)),
('color2', models.CharField(max_length=7)),
('color3', models.CharField(max_length=7)),
],
options={
'abstract': False,
},
bases=('contentcuration.node',),
),
migrations.AddField(
model_name='topictree',
name='root_node',
field=models.ForeignKey(verbose_name='root node', to='contentcuration.Node', help_text='The starting point for the tree, the title of it is the title shown in the menu'),
),
migrations.AddField(
model_name='node',
name='parent',
field=mptt.fields.TreeForeignKey(related_name='children', blank=True, to='contentcuration.Node', null=True),
),
migrations.AlterUniqueTogether(
name='node',
unique_together=set([('parent', 'name')]),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('contentcuration', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Channel',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('channel_name', models.CharField(max_length=100, verbose_name='channel name')),
('description', models.TextField(help_text='Description of what a channel contains', max_length=300, verbose_name='channel description')),
('lft', models.PositiveIntegerField(editable=False, db_index=True)),
('rght', models.PositiveIntegerField(editable=False, db_index=True)),
('tree_id', models.PositiveIntegerField(editable=False, db_index=True)),
('level', models.PositiveIntegerField(editable=False, db_index=True)),
],
options={
'verbose_name': 'Channel',
'verbose_name_plural': 'Channels',
},
),
migrations.AddField(
model_name='topictree',
name='is_published',
field=models.BooleanField(default=False, help_text='If published, students can access this channel', verbose_name='Published'),
),
migrations.AlterField(
model_name='contentnode',
name='content_file',
field=models.FileField(help_text='Upload video here', null=True, upload_to=b'contents/video/thumbnails/', blank=True),
),
migrations.AlterField(
model_name='topictree',
name='name',
field=models.CharField(help_text='Displayed to the user', max_length=255, verbose_name='topic tree name'),
),
migrations.AddField(
model_name='channel',
name='primary_topic_tree',
field=models.ForeignKey(help_text='Primary topic tree associated with this channel', to='contentcuration.TopicTree'),
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('contentcuration', '0002_auto_20150630_1700'),
]

operations = [
migrations.RenameField(
model_name='channel',
old_name='channel_name',
new_name='name',
),
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('contentcuration', '0003_auto_20150630_1703'),
]

operations = [
migrations.RemoveField(
model_name='channel',
name='level',
),
migrations.RemoveField(
model_name='channel',
name='lft',
),
migrations.RemoveField(
model_name='channel',
name='rght',
),
migrations.RemoveField(
model_name='channel',
name='tree_id',
),
]
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 models, migrations


class Migration(migrations.Migration):

dependencies = [
('contentcuration', '0004_auto_20150630_1706'),
]

operations = [
migrations.AddField(
model_name='contentnode',
name='description',
field=models.TextField(default='Description', help_text='Brief description of what this content item is', max_length=200, verbose_name='description'),
),
migrations.AddField(
model_name='contentnode',
name='title',
field=models.CharField(default='Title', help_text='Title of the content item', max_length=50, verbose_name='title'),
),
migrations.AddField(
model_name='topicnode',
name='description',
field=models.TextField(default='Description', help_text='Brief description of what is contained in this folder', max_length=200, verbose_name='description'),
),
migrations.AddField(
model_name='topicnode',
name='title',
field=models.CharField(default='Title', help_text='Folder title', max_length=50, verbose_name='title'),
),
]
Empty file.
Loading