mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +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 import forms
|
||||||
from django.forms.forms import NON_FIELD_ERRORS
|
from django.forms.forms import NON_FIELD_ERRORS
|
||||||
from django.forms.util import ErrorDict
|
from django.forms.util import ErrorDict
|
||||||
|
from reversion.revisions import RevisionManager
|
||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
@@ -19,4 +20,11 @@ def nice_errors(form, non_field_msg='General form errors'):
|
|||||||
else:
|
else:
|
||||||
key = form.fields[field].label
|
key = form.fields[field].label
|
||||||
nice_errors[key] = errors
|
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"
|
||||||
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Reference in New Issue
Block a user