Skip to content

Commit

Permalink
Merge branch 'release-1.0b1'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbengfort committed Jul 6, 2016
2 parents 737e142 + a5dbbfe commit 256a4e6
Show file tree
Hide file tree
Showing 107 changed files with 6,237 additions and 27 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright {yyyy} {name of copyright owner}
Copyright 2016 District Data Labs

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ DJANGO_POSTFIX := --settings=$(DJANGO_SETTINGS_MODULE) --pythonpath=$(PYTHONPATH

# Development Settings
LOCAL_SETTINGS := development
DJANGO_LOCAL_SETTINGS_MODULE = $(PROJECT).settings
DJANGO_LOCAL_SETTINGS_MODULE = $(PROJECT).settings.$(LOCAL_SETTINGS)
DJANGO_LOCAL_POSTFIX := --settings=$(DJANGO_LOCAL_SETTINGS_MODULE) --pythonpath=$(PYTHONPATH)

# Testing Settings
Expand All @@ -24,7 +24,7 @@ DJANGO_TEST_SETTINGS_MODULE = $(PROJECT).settings.$(TEST_SETTINGS)
DJANGO_TEST_POSTFIX := --settings=$(DJANGO_TEST_SETTINGS_MODULE) --pythonpath=$(PYTHONPATH)

# Apps to test
APPS := minent
APPS := minent fugato stream users voting

# Export targets not associated with files
.PHONY: test showenv coverage bootstrap pip virtualenv clean virtual_env_set truncate
Expand Down
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: gunicorn minent.wsgi --log-file -
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,22 +103,24 @@ The image used in this README, [Answers][answers.jpg] by [Francisco Martins](htt

## Changelog

The release versions that are sent to the Python package index (PyPI) are also tagged in Github. You can see the tags through the Github web application and download the tarball of the version you'd like. Additionally PyPI will host the various releases of Trinket (eventually).
The release versions that are sent to the Python package index (PyPI) are also tagged in Github. You can see the tags through the Github web application and download the tarball of the version you'd like. Additionally PyPI will host the various releases of Minimum Entropy (eventually).

The versioning uses a three part version system, "a.b.c" - "a" represents a major release that may not be backwards compatible. "b" is incremented on minor releases that may contain extra features, but are backwards compatible. "c" releases are bug fixes or other micro changes that developers should feel free to immediately update to.


### Version 0.1
### Version 1.0 Beta 1

* **tag**: [v0.1](#)
* **deployment**: Pending
* **commit**: [pending](#)
* **tag**: [v1.0b1](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.0b1)
* **deployment**: Tuesday, July 5, 2016
* **commit**: [see tag](#)

This beta release for Version 1.0 simply moves the code over from Kyudo and modifies it to remove the research components and only present a question and answer system. Things are not perfect since the app was designed for a different research project. However, the core functionality - asking questions and answering them with Markdown, as well as up and down voting exists. This is a good start to beta to our faculty to see what they think!

<!-- References -->
[travis_img]: https://travis-ci.org/DistrictDataLabs/minimum-entropy.svg
[travis_href]: https://travis-ci.org/DistrictDataLabs/minimum-entropy
[waffle_img]: https://badge.waffle.io/DistrictDataLabs/minimum-entropy.png?label=ready&title=Ready
[waffle_href]: https://waffle.io/DistrictDataLabs/minimum-entropy
[coveralls_img]: https://coveralls.io/repos/DistrictDataLabs/minimum-entropy/badge.svg
[coveralls_href]: https://coveralls.io/r/DistrictDataLabs/minimum-entropy
[coveralls_img]: https://coveralls.io/repos/github/DistrictDataLabs/minimum-entropy/badge.svg?branch=master
[coveralls_href]:https://coveralls.io/github/DistrictDataLabs/minimum-entropy?branch=master
[answers.jpg]: https://flic.kr/p/82Ub7z
10 changes: 5 additions & 5 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ The release versions that are sent to the Python package index (PyPI) are also t

The versioning uses a three part version system, "a.b.c" - "a" represents a major release that may not be backwards compatible. "b" is incremented on minor releases that may contain extra features, but are backwards compatible. "c" releases are bug fixes or other micro changes that developers should feel free to immediately update to.

### Version 0.1
### Version 1.0 Beta 1

* **tag**: [v0.1](#)
* **deployment**: When?
* **commit**: (see tag)
* **tag**: [v1.0b1](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.0b1)
* **deployment**: Tuesday, July 5, 2016
* **commit**: [see tag](#)

What is it?
This beta release for Version 1.0 simply moves the code over from Kyudo and modifies it to remove the research components and only present a question and answer system. Things are not perfect since the app was designed for a different research project. However, the core functionality - asking questions and answering them with Markdown, as well as up and down voting exists. This is a good start to beta to our faculty to see what they think!
20 changes: 20 additions & 0 deletions fugato/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# fugato
# The fugato app is designed to collect questions.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Thu Oct 23 14:07:41 2014 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: __init__.py [] benjamin@bengfort.com $

"""
The fugato app is designed to collect questions.
"""

##########################################################################
## Configuration
##########################################################################

default_app_config = 'fugato.apps.FugatoConfig'
29 changes: 29 additions & 0 deletions fugato/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# fugato.admin
# Description of the app for the admin site and CMS.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Jul 05 20:04:50 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: admin.py [] benjamin@bengfort.com $

"""
Description of the app for the admin site and CMS.
"""

##########################################################################
## Imports
##########################################################################


from django.contrib import admin
from fugato.models import Question, Answer

##########################################################################
## Register Models
##########################################################################

admin.site.register(Question)
admin.site.register(Answer)
31 changes: 31 additions & 0 deletions fugato/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# fugato.apps
# Describes the Fugato application for Django
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Wed Mar 04 15:38:51 2015 -0500
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: apps.py [] benjamin@bengfort.com $

"""
Describes the Fugato application for Django
"""

##########################################################################
## Imports
##########################################################################

from django.apps import AppConfig

##########################################################################
## Fugato Config
##########################################################################

class FugatoConfig(AppConfig):
name = 'fugato'
verbose_name = "Fugato"

def ready(self):
import fugato.signals
29 changes: 29 additions & 0 deletions fugato/exceptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# fugato.exceptions
# Custom exceptions for API
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Wed Jan 21 14:59:27 2015 -0500
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: exceptions.py [] benjamin@bengfort.com $

"""
Custom exceptions for API
"""

##########################################################################
## Imports
##########################################################################

from rest_framework.exceptions import APIException

##########################################################################
## API Exceptions
##########################################################################

class DuplicateQuestion(APIException):

status_code = 400
default_detail = "question has already been asked"
45 changes: 45 additions & 0 deletions fugato/managers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# fugato.managers
# Custom managers for the fugato models
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Wed Jul 22 14:03:52 2015 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: managers.py [] benjamin@bengfort.com $

"""
Custom managers for the fugato models
"""

##########################################################################
## Imports
##########################################################################

from django.db import models
from minent.utils import signature

##########################################################################
## Questions Manager
##########################################################################

class QuestionManager(models.Manager):

def dedupe(self, raise_for_exceptions=False, **kwargs):
"""
Essentially a GET or CREATE method that checks if a duplicate
question already exists in the database by its signature. If
raise_for_exceptions is True, then will raise a DuplicateQuestion
exception, otherwise it will return None.
Returns question, created where created is a Boolean
"""
qsig = signature(kwargs['text'])
query = self.filter(signature=qsig)
if query.exists():
if raise_for_exceptions:
raise DuplicateQuestion()
return query.first(), False

return self.create(**kwargs), True
66 changes: 66 additions & 0 deletions fugato/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-06 00:28
from __future__ import unicode_literals

import autoslug.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

initial = True

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

operations = [
migrations.CreateModel(
name='Answer',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('text', models.TextField(help_text='Edit in Markdown')),
('text_rendered', models.TextField(editable=False)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to=settings.AUTH_USER_MODEL)),
],
options={
'get_latest_by': 'created',
'db_table': 'answers',
},
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
('text', models.CharField(max_length=512)),
('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='text', unique=True)),
('signature', models.CharField(editable=False, max_length=28, unique=True)),
('details', models.TextField(blank=True, default=None, help_text='Edit in Markdown', null=True)),
('details_rendered', models.TextField(blank=True, default=None, editable=False, null=True)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='questions', to=settings.AUTH_USER_MODEL)),
('related', models.ManyToManyField(related_name='_question_related_+', to='fugato.Question')),
],
options={
'get_latest_by': 'created',
'db_table': 'questions',
},
),
migrations.AddField(
model_name='answer',
name='question',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='answers', to='fugato.Question'),
),
migrations.AddField(
model_name='answer',
name='related',
field=models.ManyToManyField(related_name='_answer_related_+', to='fugato.Answer'),
),
]
18 changes: 18 additions & 0 deletions fugato/migrations/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# fugato.migrations
# Database migrations for the fugato application
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Jul 05 20:03:22 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: __init__.py [] benjamin@bengfort.com $

"""
Database migrations for the fugato application
"""

##########################################################################
## Imports
##########################################################################
Loading

0 comments on commit 256a4e6

Please sign in to comment.