7 day expiry default, explain in admin interface.

parent e7e92d1a
......@@ -235,11 +235,30 @@ class CoordinateAdmin(admin.ModelAdmin):
fields = ('organization', 'geojsontype', 'area')
PROMISE_DESCRIPTION = """
<p>A 'promise' is an indication by an organisation representitive that an improvement
has been made which will alter the organizations score. A generic message will be
displayed on the organization report with the creation and expiry date of the promise
until it expires.</p>
<p>This indication is to overcome the problem of a negative score even though improvement
are made, but the score cannot reflect them yet due to technical or bureaucratic reasons.</p>
<p>It is not intended for long term promises of improvement that have not been applied or
put in to progress. The promised improvement must be verifiable by Faalkaart within a
handfull of days.</p>
"""
class PromiseAdmin(admin.ModelAdmin):
list_display = ('organization', 'created_on', 'expires_on')
search_fields = ('organization',)
list_filter = ('organization',)
fields = ('organization', 'created_on', 'expires_on', 'notes')
fieldsets = (
(None, {
'fields': ('organization', 'created_on', 'expires_on', 'notes'),
'description': PROMISE_DESCRIPTION,
}),
)
admin.site.register(Organization, OrganizationAdmin)
......
# coding=UTF-8
# from __future__ import unicode_literals
from datetime import datetime
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.db import models
......@@ -174,8 +174,10 @@ class Promise(models.Model):
null=True,
help_text="Context information about the promise (eg: ticket reference).")
created_on = models.DateTimeField(default=datetime.now, blank=True, null=True)
created_on = models.DateTimeField(
default=datetime.today, blank=True, null=True)
expires_on = models.DateTimeField(
default=lambda: datetime.now() + timedelta(days=7),
blank=True,
null=True,
help_text="When in the future this promise is expected to be fulfilled.")
......
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