mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2025-01-30 07:02:44 +00:00
[svn r8255]
This commit is contained in:
parent
0c56ff0718
commit
40e47f368b
@ -1,5 +1,6 @@
|
|||||||
from troggle.expo.models import *
|
from troggle.expo.models import *
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
#from troggle.reversion.admin import VersionAdmin #django-reversion version control
|
||||||
|
|
||||||
class RoleInline(admin.TabularInline):
|
class RoleInline(admin.TabularInline):
|
||||||
model = PersonRole
|
model = PersonRole
|
||||||
@ -15,6 +16,7 @@ class ScannedImageInline(admin.TabularInline):
|
|||||||
class SurveyAdmin(admin.ModelAdmin):
|
class SurveyAdmin(admin.ModelAdmin):
|
||||||
inlines = (ScannedImageInline,)
|
inlines = (ScannedImageInline,)
|
||||||
|
|
||||||
|
#class LogbookEntryAdmin(VersionAdmin):
|
||||||
class LogbookEntryAdmin(admin.ModelAdmin):
|
class LogbookEntryAdmin(admin.ModelAdmin):
|
||||||
search_fields = ('title','expedition__year')
|
search_fields = ('title','expedition__year')
|
||||||
|
|
||||||
|
@ -11,7 +11,13 @@ import datetime
|
|||||||
|
|
||||||
from models_survex import *
|
from models_survex import *
|
||||||
|
|
||||||
class Expedition(models.Model):
|
class Model(models.Model):
|
||||||
|
new_since_parsing = models.BooleanField(default=False)
|
||||||
|
def save(self):
|
||||||
|
new_since_parsing = True
|
||||||
|
super(Model, self).save()
|
||||||
|
|
||||||
|
class Expedition(Model):
|
||||||
year = models.CharField(max_length=20, unique=True)
|
year = models.CharField(max_length=20, unique=True)
|
||||||
name = models.CharField(max_length=100)
|
name = models.CharField(max_length=100)
|
||||||
date_from = models.DateField(blank=True,null=True)
|
date_from = models.DateField(blank=True,null=True)
|
||||||
@ -59,7 +65,7 @@ class Expedition(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Person(models.Model):
|
class Person(Model):
|
||||||
first_name = models.CharField(max_length=100)
|
first_name = models.CharField(max_length=100)
|
||||||
last_name = models.CharField(max_length=100)
|
last_name = models.CharField(max_length=100)
|
||||||
is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.")
|
is_vfho = models.BooleanField(help_text="VFHO is the Vereines für Höhlenkunde in Obersteier, a nearby Austrian caving club.")
|
||||||
@ -93,15 +99,15 @@ class Person(models.Model):
|
|||||||
# def Lastexpedition(self):
|
# def Lastexpedition(self):
|
||||||
# return self.personexpedition_set.order_by('-expedition')[0]
|
# return self.personexpedition_set.order_by('-expedition')[0]
|
||||||
|
|
||||||
#def notability(self):
|
def notability(self):
|
||||||
#notability = 0.0
|
notability = 0.0
|
||||||
#for personexpedition in person.personexpedition_set.all():
|
for personexpedition in Person.personexpedition_set.all():
|
||||||
#if not personexpedition.is_guest:
|
if not personexpedition.is_guest:
|
||||||
#notability += 1.0 / (2012 - int(self.personexpedition.expedition.year))
|
notability += 1.0 / (2012 - int(self.personexpedition.expedition.year))
|
||||||
#return notability
|
return notability
|
||||||
|
|
||||||
#def bisnotable(self):
|
def bisnotable(self):
|
||||||
#return self.notability > 0.3
|
return self.notability > 0.3
|
||||||
|
|
||||||
#def Sethref(self):
|
#def Sethref(self):
|
||||||
#if self.last_name:
|
#if self.last_name:
|
||||||
@ -113,12 +119,11 @@ class Person(models.Model):
|
|||||||
#self.notability = 0.0 # set temporarily
|
#self.notability = 0.0 # set temporarily
|
||||||
|
|
||||||
|
|
||||||
class PersonExpedition(models.Model):
|
class PersonExpedition(Model):
|
||||||
expedition = models.ForeignKey(Expedition)
|
expedition = models.ForeignKey(Expedition)
|
||||||
person = models.ForeignKey(Person)
|
person = models.ForeignKey(Person)
|
||||||
date_from = models.DateField(blank=True,null=True)
|
date_from = models.DateField(blank=True,null=True)
|
||||||
date_to = models.DateField(blank=True,null=True)
|
date_to = models.DateField(blank=True,null=True)
|
||||||
dates_guessed = models.BooleanField(default=False)
|
|
||||||
is_guest = models.BooleanField(default=False)
|
is_guest = models.BooleanField(default=False)
|
||||||
COMMITTEE_CHOICES = (
|
COMMITTEE_CHOICES = (
|
||||||
('leader','Expo leader'),
|
('leader','Expo leader'),
|
||||||
|
@ -8,7 +8,7 @@ from troggle.alwaysUseRequestContext import render_response # see views_logbooks
|
|||||||
def caveindex(request):
|
def caveindex(request):
|
||||||
caves = Cave.objects.all()
|
caves = Cave.objects.all()
|
||||||
notablecavehrefs = [ "161", "204", "258", "76" ] # could detect notability by trips and notability of people who have been down them
|
notablecavehrefs = [ "161", "204", "258", "76" ] # could detect notability by trips and notability of people who have been down them
|
||||||
notablecaves = [ Cave.objects.get(href=href) for href in notablecavehrefs ]
|
notablecaves = [Cave.objects.get(kataster_number=kataster_number) for kataster_number in notablecavehrefs ]
|
||||||
return render_response(request,'caveindex.html', {'caves': caves, 'notablecaves':notablecaves})
|
return render_response(request,'caveindex.html', {'caves': caves, 'notablecaves':notablecaves})
|
||||||
|
|
||||||
def cavehref(request, cave_id='', offical_name=''):
|
def cavehref(request, cave_id='', offical_name=''):
|
||||||
|
@ -14,6 +14,13 @@ import re
|
|||||||
|
|
||||||
@models.permalink #this allows the nice get_absolute_url syntax we are using
|
@models.permalink #this allows the nice get_absolute_url syntax we are using
|
||||||
|
|
||||||
|
def getNotablePersons():
|
||||||
|
notablepersons = []
|
||||||
|
for person in Person.objects.all():
|
||||||
|
if person.bisnotable():
|
||||||
|
notablepersons.append(person)
|
||||||
|
return notablepersons
|
||||||
|
|
||||||
def personindex(request):
|
def personindex(request):
|
||||||
persons = Person.objects.all()
|
persons = Person.objects.all()
|
||||||
# From what I can tell, "persons" seems to be the table rows, while "personss" is the table columns. - AC 16 Feb 09
|
# From what I can tell, "persons" seems to be the table rows, while "personss" is the table columns. - AC 16 Feb 09
|
||||||
@ -23,7 +30,11 @@ def personindex(request):
|
|||||||
for i in range(ncols):
|
for i in range(ncols):
|
||||||
personss.append(persons[i * nc: (i + 1) * nc])
|
personss.append(persons[i * nc: (i + 1) * nc])
|
||||||
|
|
||||||
notablepersons = Person.objects.filter(bisnotable=True)
|
notablepersons = []
|
||||||
|
for person in Person.objects.all():
|
||||||
|
if person.bisnotable():
|
||||||
|
notablepersons.append(person)
|
||||||
|
|
||||||
return render_response(request,'personindex.html', {'persons': persons, 'personss':personss, 'notablepersons':notablepersons, })
|
return render_response(request,'personindex.html', {'persons': persons, 'personss':personss, 'notablepersons':notablepersons, })
|
||||||
|
|
||||||
def expedition(request, expeditionname):
|
def expedition(request, expeditionname):
|
||||||
|
@ -106,7 +106,7 @@ def LoadPersonsExpos():
|
|||||||
persons = list(models.Person.objects.filter(first_name=firstname, last_name=lastname))
|
persons = list(models.Person.objects.filter(first_name=firstname, last_name=lastname))
|
||||||
if not persons:
|
if not persons:
|
||||||
person = models.Person(first_name=firstname, last_name = lastname, is_vfho = False, mug_shot = "")
|
person = models.Person(first_name=firstname, last_name = lastname, is_vfho = False, mug_shot = "")
|
||||||
person.Sethref()
|
#person.Sethref()
|
||||||
person.save()
|
person.save()
|
||||||
else:
|
else:
|
||||||
person = persons[0]
|
person = persons[0]
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block contentheader %}
|
||||||
|
<h1>Profile for {{ profile }}</h1>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{{ profile }}
|
{{ profile }}
|
||||||
|
@ -9,5 +9,5 @@ registration_complete.html | {{ block.super }}
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
Thank you for signing up, {{ user.username }}. An email with the activation code has been sent to your inbox. Please <a href={% url profiles_create_profile %}> create your profile</a>. If you have been on the expedition in the past, this step allows existing expedition data to be linked to your new account.
|
Thank you for signing up, {{ user.username }}. An email with the activation code has been sent to your inbox. If you have been on the expedition in the past, you already have a profile in the system; <a href={% url profiles_select_profile %}>click here </a> to find it and link it to your account. Otherwise, please <a href={% url profiles_create_profile %}> create yourself a new profile</a>. If you have been on the expedition in the past, this step allows existing expedition data to be linked to your new account.
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -12,12 +12,12 @@ urlpatterns = patterns('',
|
|||||||
|
|
||||||
url(r'^$', views_other.frontpage, name="frontpage"),
|
url(r'^$', views_other.frontpage, name="frontpage"),
|
||||||
|
|
||||||
url(r'^caveindex$', views_caves.caveindex, name="caveindex"),
|
url(r'^caveindex/?$', views_caves.caveindex, name="caveindex"),
|
||||||
url(r'^personindex$', views_logbooks.personindex, name="personindex"),
|
url(r'^personindex$', views_logbooks.personindex, name="personindex"),
|
||||||
|
|
||||||
|
|
||||||
#(r'^person/(?P<person_id>\d*)/?$', views_logbooks.person),
|
#(r'^person/(?P<person_id>\d*)/?$', views_logbooks.person),
|
||||||
url(r'^person/(?P<first_name>[A-Z]*[a-z]*)[^a-zA-Z]*(?P<last_name>[A-Z]*[a-z]*)/?', views_logbooks.person, name="person"),
|
url(r'^person/(?P<first_name>[A-Z]*[a-z\-\']*)[^a-zA-Z]*(?P<last_name>[A-Z]*[a-z\-]*)/?', views_logbooks.person, name="person"),
|
||||||
#url(r'^person/(\w+_\w+)$', views_logbooks.person, name="person"),
|
#url(r'^person/(\w+_\w+)$', views_logbooks.person, name="person"),
|
||||||
|
|
||||||
url(r'^expedition/(\d+)$', views_logbooks.expedition, name="expedition"),
|
url(r'^expedition/(\d+)$', views_logbooks.expedition, name="expedition"),
|
||||||
|
Loading…
Reference in New Issue
Block a user