mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 13:32:15 +00:00
Started work on a last edited at feature.
This commit is contained in:
@@ -2,6 +2,7 @@ from django import template
|
||||
from django import forms
|
||||
from django.forms.forms import NON_FIELD_ERRORS
|
||||
from django.forms.util import ErrorDict
|
||||
from reversion.revisions import RevisionManager
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@@ -19,4 +20,11 @@ def nice_errors(form, non_field_msg='General form errors'):
|
||||
else:
|
||||
key = form.fields[field].label
|
||||
nice_errors[key] = errors
|
||||
return nice_errors
|
||||
return nice_errors
|
||||
|
||||
def lastedit(model):
|
||||
if RevisionManager.is_registered(model):
|
||||
versions = RevisionManager.get_for_object(model)
|
||||
return versions[0].createdAt
|
||||
else:
|
||||
return "No version model saved"
|
||||
Reference in New Issue
Block a user