Commit 1a72bc9a authored by luxcem's avatar luxcem
Browse files
parent 64de05ea
...@@ -36,7 +36,9 @@ INSTALLED_APPS = ( ...@@ -36,7 +36,9 @@ INSTALLED_APPS = (
'django.contrib.sessions', 'django.contrib.sessions',
'django.contrib.messages', 'django.contrib.messages',
'django.contrib.staticfiles', 'django.contrib.staticfiles',
# ---
'compressor', 'compressor',
'chronograph',
# --- # ---
'core', 'core',
'representatives', 'representatives',
...@@ -94,6 +96,10 @@ STATIC_URL = '/static/' ...@@ -94,6 +96,10 @@ STATIC_URL = '/static/'
# HAML Templates # HAML Templates
# https://github.com/jessemiller/hamlpy # https://github.com/jessemiller/hamlpy
TEMPLATE_DIRS = (
'core/templates',
)
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader', 'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader', 'django.template.loaders.app_directories.Loader',
...@@ -114,7 +120,7 @@ TEMPLATE_LOADERS = ( ...@@ -114,7 +120,7 @@ TEMPLATE_LOADERS = (
STATIC_URL = '/static/' STATIC_URL = '/static/'
COMPRESS_ROOT = 'static/' COMPRESS_ROOT = 'static/'
COMPRESS_ENABLED = True
STATICFILES_FINDERS = ( STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
......
from django.contrib import admin 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 @@ ...@@ -6,8 +6,10 @@
- for representative in memopolrepresentative_list - for representative in memopolrepresentative_list
%p %p
= representative.full_name = representative.full_name
= representative.email - for email in representative.email_set.all
%p
= email.email
.large-4.columns .large-4.columns
%p %p
hello hello
...@@ -9,5 +9,4 @@ class IndexView(generic.ListView): ...@@ -9,5 +9,4 @@ class IndexView(generic.ListView):
template_name = 'memopol_representatives/list.html' template_name = 'memopol_representatives/list.html'
def get_queryset(self): def get_queryset(self):
"""Return the last five published questions."""
return MemopolRepresentative.objects.all() 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