Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

file 35 lines (28 sloc) 1.093 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
import deform
import re
import unicodedata

TS_FORMAT = "%Y-%m-%d %H:%M:%S.%f"


def normalize(title):
    """
make an URL resource name ready for use in a URL. Essentially it
takes a string representing an id or title and makes it character
safe for use in a URL. In ``lumin`` this is likely to be the
:term:`_id` or the :term:`__name__` by which we find the resource.
"""
    url_safer = unicodedata.normalize('NFKD', title).encode('ascii', 'ignore')
    url_safe = unicode(re.sub('[^\w\s-]', '', url_safer).strip().lower())
    return re.sub('[-\s]+', '-', url_safe)



## buttons
reset = deform.form.Button(name='reset', title='Reset',
                           type='reset', value='reset')

##TODO: need to fork deform and make button take onClick
cancel = deform.form.Button(name='cancel', title='Cancel',
                            type='button', value='cancel',)
"""
To use this cancel button you must include some javascript
$(document).ready(function () {
$(function () {
$("#deformcancel").attr('onClick', "history.back()");
});
});
"""
Something went wrong with that request. Please try again.