Commit 1a72bc9a authored by luxcem's avatar luxcem
parent 64de05ea
......@@ -36,7 +36,9 @@ INSTALLED_APPS = (
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# ---
'compressor',
'chronograph',
# ---
'core',
'representatives',
......@@ -94,6 +96,10 @@ STATIC_URL = '/static/'
# HAML Templates
# https://github.com/jessemiller/hamlpy
TEMPLATE_DIRS = (
'core/templates',
)
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
......@@ -114,7 +120,7 @@ TEMPLATE_LOADERS = (
STATIC_URL = '/static/'
COMPRESS_ROOT = 'static/'
COMPRESS_ENABLED = True
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
......
from django.contrib import admin
# Register your models here.
import representatives.models as models
from memopol_representatives.models import MemopolRepresentative
class EmailInline(admin.TabularInline):
model = models.Email
extra = 0
class WebsiteInline(admin.TabularInline):
model = models.WebSite
extra = 0
class AdressInline(admin.StackedInline):
model = models.Address
extra = 0
class PhoneInline(admin.TabularInline):
model = models.Phone
extra = 0
class MandateInline(admin.StackedInline):
model = models.Mandate
extra = 0
class RepresentativeAdmin(admin.ModelAdmin):
list_display = ('full_name', 'gender', 'birth_place')
search_fields = ('first_name', 'last_name', 'birth_place')
list_filter = ('gender', )
inlines = [
PhoneInline,
EmailInline,
WebsiteInline,
AdressInline,
MandateInline
]
class MandateAdmin(admin.ModelAdmin):
list_display = ('kind', 'name', 'constituency', 'representative')
search_fields = ('kind', 'name')
list_filter = ('kind',)
admin.site.register(MemopolRepresentative, RepresentativeAdmin)
admin.site.register(models.Country)
admin.site.register(models.Mandate, MandateAdmin)
......@@ -6,8 +6,10 @@
- for representative in memopolrepresentative_list
%p
= representative.full_name
= representative.email
- for email in representative.email_set.all
%p
= email.email
.large-4.columns
%p
hello
......@@ -9,5 +9,4 @@ class IndexView(generic.ListView):
template_name = 'memopol_representatives/list.html'
def get_queryset(self):
"""Return the last five published questions."""
return MemopolRepresentative.objects.all()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment