Skip to content

Commit

Permalink
Merge pull request #153 from open-austin/enable_admin
Browse files Browse the repository at this point in the history
NOREF: added admin page functionality.
  • Loading branch information
lazarus1331 authored Aug 28, 2020
2 parents ba42856 + 5d50ade commit b3ffb01
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ nginx.conf-integration
__pycache__
*.pyc
influencetx/static/react-app
frontend/
6 changes: 3 additions & 3 deletions src/config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@
# 'django.contrib.humanize',

# Admin
#'django.contrib.admin',
'django.contrib.admin',
]
THIRD_PARTY_APPS = [
'crispy_forms', # Form layouts
#'allauth', # registration
#'allauth.account', # registration
'allauth', # registration
'allauth.account', # registration
#'allauth.socialaccount', # registration
]

Expand Down
2 changes: 1 addition & 1 deletion src/config/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
url(r'^findreps/$', TemplateView.as_view(template_name='pages/findreps.html'), name='findreps'),

# Django Admin, use {% url 'admin:index' %}
#url(settings.ADMIN_URL, admin.site.urls),
url(settings.ADMIN_URL, admin.site.urls),

# User management
# url(r'^users/', include('influencetx.users.urls', namespace='users')),
Expand Down
1 change: 1 addition & 0 deletions src/docker-compose.vagrant
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ services:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile.local
image: inftxosfrontend:dev
command: "npm start"
environment:
Expand Down
2 changes: 1 addition & 1 deletion src/influencetx/bills/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

admin.site.register(models.Bill)
admin.site.register(models.SubjectTag)
admin.site.register(models.ActionDates)
admin.site.register(models.ActionDate)
admin.site.register(models.VoteTally)
admin.site.register(models.SingleVote)
25 changes: 25 additions & 0 deletions src/influencetx/legislators/migrations/0002_auto_20200826_0033.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-08-26 00:33
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

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

operations = [
migrations.AddField(
model_name='legislator',
name='tpj_filer_id',
field=models.IntegerField(blank=True, db_index=True, default=0),
),
migrations.AddField(
model_name='legislator',
name='tx_lege_id',
field=models.CharField(blank=True, db_index=True, max_length=48),
),
]
4 changes: 3 additions & 1 deletion src/influencetx/legislators/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
class Legislator(models.Model):
# Legislator ID from Open States API.
openstates_leg_id = models.CharField(max_length=48, db_index=True)
tpj_filer_id = models.IntegerField(default=0, blank=True, db_index=True)
tx_lege_id = models.CharField(max_length=48, blank=True, db_index=True)
name = models.CharField(max_length=45)
first_name = models.CharField(max_length=20, blank=True)
last_name = models.CharField(max_length=20, blank=True)
Expand Down Expand Up @@ -34,7 +36,7 @@ def chamber_label(self):
return utils.chamber_label(self.chamber)

def __str__(self):
return self.name
return f'{self.name} {self.tx_lege_id}'


class LegislatorIdMap(models.Model):
Expand Down
9 changes: 9 additions & 0 deletions src/influencetx/tpj/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from django.contrib import admin

from . import models

admin.site.register(models.Donor)
admin.site.register(models.Filer)
admin.site.register(models.Contribution)
admin.site.register(models.Contributionsummary)
admin.site.register(models.Contributiontotalbydonor)
20 changes: 20 additions & 0 deletions src/influencetx/users/migrations/0003_auto_20200826_0033.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2020-08-26 00:33
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('users', '0002_auto_20200709_0256'),
]

operations = [
migrations.AlterField(
model_name='user',
name='last_name',
field=models.CharField(blank=True, max_length=30, verbose_name='last name'),
),
]
8 changes: 5 additions & 3 deletions src/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
wheel==0.33.1

django==2.2.14
graphene
graphene-django
django-cors-headers
graphene==2.1.8
graphene-django==2.13.0
django-cors-headers==3.5.0
django-filter>=2
django-allauth==0.42.0

# Configuration
django-environ==0.4.5
Expand All @@ -25,6 +26,7 @@ django-model-utils==3.1.2
Pillow==6.2.0

# Password storage
argon2-cffi==20.1.0

# For user registration, either via email or social
# Well-built with regular release cycles!
Expand Down

0 comments on commit b3ffb01

Please sign in to comment.