Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into annabunches/docke…
Browse files Browse the repository at this point in the history
…rfile-fixes
  • Loading branch information
annabunches committed Jul 30, 2020
2 parents 1a96498 + 3aa0dc8 commit 44cdc8a
Show file tree
Hide file tree
Showing 28 changed files with 775 additions and 198 deletions.
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

## Summary of the Bug
A clear and concise description of what the bug is.

## Steps to Reproduce the Behaviour
**i.e.,**
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

## The Expected Behaviour
Concise description of what you expected to happen.

## Screenshots
If applicable, add screenshots to help explain your problem.

## Hardware and Software Information

### Desktop
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

### Smartphone
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

## Notes
Add any other information about the bug which you thing may be helpful.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement, feature request
assignees: ''

---

## Is your feature request related to a problem?
A clear and concise description of what you would like to see added to the AGAGD.

## Describe the feature you'd like to see on the AGAGD.
A clear and concise description of the feature you would like to see.

## Notes
Add any other information or screenshots about the feature request here.
12 changes: 6 additions & 6 deletions agagd/agagd/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

PROJECT_ROOT = os.environ['PROJECT_ROOT']

ADMINS = (
('Andrew Jackson', 'operations@usgo.org'),
)
ADMINS = [
('Admins', 'webmaster@usgo.org'),
]

MANAGERS = ADMINS

ALLOWED_HOSTS = ['test.agagd.usgo.org', 'agagd.usgo.org']
ALLOWED_HOSTS = ['localhost', 'test.agagd.usgo.org', 'agagd.usgo.org']

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
Expand All @@ -36,12 +36,12 @@

# Absolute filesystem path to the directory that will hold user-uploaded files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
MEDIA_URL = ''
MEDIA_URL = '/media/'

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
Expand Down
2 changes: 1 addition & 1 deletion agagd/agagd/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
}
}

TEMPLATE_DIRS = (_templates, )
TEMPLATES[0]['DIRS'] = [ _templates ]
5 changes: 4 additions & 1 deletion agagd/agagd/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from django.conf.urls import url
from django.conf.urls.static import static
from django.conf import settings
from django.core.urlresolvers import reverse_lazy
from django.views.generic import RedirectView
from agagd_core import views as agagd_views
Expand All @@ -13,6 +15,7 @@
url(r'^country/(?P<country_name>[\w ]+)/$', agagd_views.country_detail, name='country_detail'),
url(r'^player/(?P<member_id>\d+)/vs/$', agagd_views.find_member_vs, name='find_member_vs'),
url(r'^player/(?P<member_id>\d+)/vs/(?P<other_id>\d+)$', agagd_views.member_vs, name='member_vs'),
url(r'^all_player_ratings/$', agagd_views.all_player_ratings, name='all_player_ratings'),

url(r'^ratings/(?P<member_id>\d+)/$', agagd_views.member_ratings, name='member_ratings'),
url(r'^gamestats/$', agagd_views.game_stats, name='game_stats'),
Expand All @@ -23,4 +26,4 @@
# Static Pages
url(r'^information/$', agagd_views.information),
url(r'^qualifications/$', agagd_views.qualifications)
]
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
11 changes: 4 additions & 7 deletions agagd/agagd/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@
# This application object is used by any WSGI server configured to use this
# file. This includes Django's development server, if the WSGI_APPLICATION
# setting points here.
import django.core.handlers.wsgi
_application = django.core.handlers.wsgi.WSGIHandler()
from django.core.wsgi import get_wsgi_application

def application(environ, start_response):
def bootstrap_env(environ, start_response):
for key in ['DJANGO_SETTINGS_MODULE', 'AGAGD_USER', 'MYSQL_PASS', 'APP_DB_NAME', 'SECRET_KEY', 'TEMPLATE_DIR']:
if key in environ:
os.environ[key] = environ[key]
_application = get_wsgi_application()
return _application(environ, start_response)


# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)
application = bootstrap_env
4 changes: 2 additions & 2 deletions agagd/agagd_core/json_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
from django.core.serializers import json, serialize
from django.db.models.query import QuerySet
from django.http import HttpResponse
import simplejson
import json as python_json

class JsonResponse(HttpResponse):
def __init__(self, object):
if isinstance(object, QuerySet):
content = serialize('json', object)
else:
content = simplejson.dumps(
content = python_json.dumps(
object, indent=2, cls=json.DjangoJSONEncoder,
ensure_ascii=False)
super(JsonResponse, self).__init__(
Expand Down
16 changes: 16 additions & 0 deletions agagd/agagd_core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Meta:
join_date = models.DateField(null=True, blank=True)
city = models.CharField(max_length=255, blank=True)
state = models.CharField(max_length=255, blank=True)
status = models.CharField(max_length=255, null=True)
region = models.CharField(max_length=255, blank=True)
country = models.CharField(max_length=255)
chapter = models.CharField(max_length=100, blank=True)
Expand All @@ -45,6 +46,9 @@ class Meta:
managed = False

class Chapters(models.Model):
# ForeignKey for Member
member = models.ForeignKey(Member)

# TODO this is not member_id? seems more like a normal pk for ChapterInfo
member_id = models.CharField(max_length=255, primary_key=True) # This field type is a guess.
name = models.CharField(max_length=255, blank=True)
Expand Down Expand Up @@ -202,7 +206,19 @@ def winner(self):
def won_by(self, p1):
return self.winner() == p1

# Updated Rating Information Table for Players.
class Players(models.Model):
pin_player = models.ForeignKey(Member, db_column=u'Pin_Player', primary_key=True)
rating = models.FloatField(db_column=u'Rating') # x. This field type is a guess.
sigma = models.FloatField(db_column=u'Sigma') # x. This field type is a guess.
elab_date = models.DateField(db_column=u'Elab_Date')
class Meta:
managed = False
db_table = u'players'

class Rating(models.Model):
# ForeignKey for the Members
member_id = models.ForeignKey(Member, db_column=u'Pin_Player')
pin_player = models.ForeignKey(Member, db_column=u'Pin_Player', related_name='ratings_set', primary_key=True)
tournament = models.ForeignKey(Tournament, db_column=u'Tournament_Code', related_name='ratings_set')
rating = models.FloatField(db_column=u'Rating') # x. This field type is a guess.
Expand Down
Loading

0 comments on commit 44cdc8a

Please sign in to comment.