Skip to content

Commit 256a4e6

Browse files
committed
Merge branch 'release-1.0b1'
2 parents 737e142 + a5dbbfe commit 256a4e6

File tree

107 files changed

+6237
-27
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+6237
-27
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright 2016 District Data Labs
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ DJANGO_POSTFIX := --settings=$(DJANGO_SETTINGS_MODULE) --pythonpath=$(PYTHONPATH
1515

1616
# Development Settings
1717
LOCAL_SETTINGS := development
18-
DJANGO_LOCAL_SETTINGS_MODULE = $(PROJECT).settings
18+
DJANGO_LOCAL_SETTINGS_MODULE = $(PROJECT).settings.$(LOCAL_SETTINGS)
1919
DJANGO_LOCAL_POSTFIX := --settings=$(DJANGO_LOCAL_SETTINGS_MODULE) --pythonpath=$(PYTHONPATH)
2020

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

2626
# Apps to test
27-
APPS := minent
27+
APPS := minent fugato stream users voting
2828

2929
# Export targets not associated with files
3030
.PHONY: test showenv coverage bootstrap pip virtualenv clean virtual_env_set truncate

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: gunicorn minent.wsgi --log-file -

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,22 +103,24 @@ The image used in this README, [Answers][answers.jpg] by [Francisco Martins](htt
103103

104104
## Changelog
105105

106-
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).
106+
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).
107107

108108
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.
109109

110110

111-
### Version 0.1
111+
### Version 1.0 Beta 1
112112

113-
* **tag**: [v0.1](#)
114-
* **deployment**: Pending
115-
* **commit**: [pending](#)
113+
* **tag**: [v1.0b1](https://github.com/DistrictDataLabs/minimum-entropy/releases/tag/v1.0b1)
114+
* **deployment**: Tuesday, July 5, 2016
115+
* **commit**: [see tag](#)
116+
117+
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!
116118

117119
<!-- References -->
118120
[travis_img]: https://travis-ci.org/DistrictDataLabs/minimum-entropy.svg
119121
[travis_href]: https://travis-ci.org/DistrictDataLabs/minimum-entropy
120122
[waffle_img]: https://badge.waffle.io/DistrictDataLabs/minimum-entropy.png?label=ready&title=Ready
121123
[waffle_href]: https://waffle.io/DistrictDataLabs/minimum-entropy
122-
[coveralls_img]: https://coveralls.io/repos/DistrictDataLabs/minimum-entropy/badge.svg
123-
[coveralls_href]: https://coveralls.io/r/DistrictDataLabs/minimum-entropy
124+
[coveralls_img]: https://coveralls.io/repos/github/DistrictDataLabs/minimum-entropy/badge.svg?branch=master
125+
[coveralls_href]:https://coveralls.io/github/DistrictDataLabs/minimum-entropy?branch=master
124126
[answers.jpg]: https://flic.kr/p/82Ub7z

docs/about.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ The release versions that are sent to the Python package index (PyPI) are also t
4949

5050
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.
5151

52-
### Version 0.1
52+
### Version 1.0 Beta 1
5353

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

58-
What is it?
58+
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!

fugato/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# fugato
2+
# The fugato app is designed to collect questions.
3+
#
4+
# Author: Benjamin Bengfort <[email protected]>
5+
# Created: Thu Oct 23 14:07:41 2014 -0400
6+
#
7+
# Copyright (C) 2016 District Data Labs
8+
# For license information, see LICENSE.txt
9+
#
10+
# ID: __init__.py [] [email protected] $
11+
12+
"""
13+
The fugato app is designed to collect questions.
14+
"""
15+
16+
##########################################################################
17+
## Configuration
18+
##########################################################################
19+
20+
default_app_config = 'fugato.apps.FugatoConfig'

fugato/admin.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# fugato.admin
2+
# Description of the app for the admin site and CMS.
3+
#
4+
# Author: Benjamin Bengfort <[email protected]>
5+
# Created: Tue Jul 05 20:04:50 2016 -0400
6+
#
7+
# Copyright (C) 2016 District Data Labs
8+
# For license information, see LICENSE.txt
9+
#
10+
# ID: admin.py [] [email protected] $
11+
12+
"""
13+
Description of the app for the admin site and CMS.
14+
"""
15+
16+
##########################################################################
17+
## Imports
18+
##########################################################################
19+
20+
21+
from django.contrib import admin
22+
from fugato.models import Question, Answer
23+
24+
##########################################################################
25+
## Register Models
26+
##########################################################################
27+
28+
admin.site.register(Question)
29+
admin.site.register(Answer)

fugato/apps.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# fugato.apps
2+
# Describes the Fugato application for Django
3+
#
4+
# Author: Benjamin Bengfort <[email protected]>
5+
# Created: Wed Mar 04 15:38:51 2015 -0500
6+
#
7+
# Copyright (C) 2016 District Data Labs
8+
# For license information, see LICENSE.txt
9+
#
10+
# ID: apps.py [] [email protected] $
11+
12+
"""
13+
Describes the Fugato application for Django
14+
"""
15+
16+
##########################################################################
17+
## Imports
18+
##########################################################################
19+
20+
from django.apps import AppConfig
21+
22+
##########################################################################
23+
## Fugato Config
24+
##########################################################################
25+
26+
class FugatoConfig(AppConfig):
27+
name = 'fugato'
28+
verbose_name = "Fugato"
29+
30+
def ready(self):
31+
import fugato.signals

fugato/exceptions.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# fugato.exceptions
2+
# Custom exceptions for API
3+
#
4+
# Author: Benjamin Bengfort <[email protected]>
5+
# Created: Wed Jan 21 14:59:27 2015 -0500
6+
#
7+
# Copyright (C) 2016 District Data Labs
8+
# For license information, see LICENSE.txt
9+
#
10+
# ID: exceptions.py [] [email protected] $
11+
12+
"""
13+
Custom exceptions for API
14+
"""
15+
16+
##########################################################################
17+
## Imports
18+
##########################################################################
19+
20+
from rest_framework.exceptions import APIException
21+
22+
##########################################################################
23+
## API Exceptions
24+
##########################################################################
25+
26+
class DuplicateQuestion(APIException):
27+
28+
status_code = 400
29+
default_detail = "question has already been asked"

fugato/managers.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# fugato.managers
2+
# Custom managers for the fugato models
3+
#
4+
# Author: Benjamin Bengfort <[email protected]>
5+
# Created: Wed Jul 22 14:03:52 2015 -0400
6+
#
7+
# Copyright (C) 2016 District Data Labs
8+
# For license information, see LICENSE.txt
9+
#
10+
# ID: managers.py [] [email protected] $
11+
12+
"""
13+
Custom managers for the fugato models
14+
"""
15+
16+
##########################################################################
17+
## Imports
18+
##########################################################################
19+
20+
from django.db import models
21+
from minent.utils import signature
22+
23+
##########################################################################
24+
## Questions Manager
25+
##########################################################################
26+
27+
class QuestionManager(models.Manager):
28+
29+
def dedupe(self, raise_for_exceptions=False, **kwargs):
30+
"""
31+
Essentially a GET or CREATE method that checks if a duplicate
32+
question already exists in the database by its signature. If
33+
raise_for_exceptions is True, then will raise a DuplicateQuestion
34+
exception, otherwise it will return None.
35+
36+
Returns question, created where created is a Boolean
37+
"""
38+
qsig = signature(kwargs['text'])
39+
query = self.filter(signature=qsig)
40+
if query.exists():
41+
if raise_for_exceptions:
42+
raise DuplicateQuestion()
43+
return query.first(), False
44+
45+
return self.create(**kwargs), True

0 commit comments

Comments
 (0)