Skip to content

Commit dc94367

Browse files
authored
Omero web 5.6 compatability (#8)
* Added Python3 Support * Made templates compatible with django 1.11 * Fixed ice objects and used JsonResponse * Update sdist build and bump to version 1.1.0 * Remove non-pip install instructions * Fixed typo in README * Updated release script for pypi changes
1 parent 0c6aa56 commit dc94367

File tree

9 files changed

+557
-693
lines changed

9 files changed

+557
-693
lines changed

README.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,13 @@ Once the user has populated the form to their satisfaction and it is valid, the
7070
Centre Panel Plugin - History
7171
=============================
7272

73-
The centre penal plugin History is where users can view the history of metadata for the current OMERO object.
73+
The centre panel plugin History is where users can view the history of metadata for the current OMERO object.
7474

7575
The list of changes in reverse chronological order are presented on the left along with the timestamp at which they were entered, the user name of the editor and the change message (if present). Selecting any of these changes will render the form that was used to enter those changes on the right, populated with the metadata that was submitted in that change.
7676

7777
Installation
7878
============
7979

80-
The recommended installation makes use of `pip`, but other options are possible as documentated `in the offical OME docs <https://www.openmicroscopy.org/site/support/omero5/developers/Web/CreateApp.html#add-your-app-location-to-your-pythonpath>`_.
81-
8280
Before configuring the plugin, create an administrative user in OMERO. In this example that user is called 'formmaster'. This user should not be a member of any groups other than the 'system' group that all administrators are a part of. Give this user a secure password. This can be done with the CLI.
8381

8482
::

omero_forms/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
"OMERO_FORMS_PRIV_USER",
88
None,
99
str,
10-
"The priviledged username to be used for storing key-values"
10+
"The priviledged username to be used for storing key-values",
1111
],
1212
"omero.web.forms.priv.password": [
1313
"OMERO_FORMS_PRIV_PASSWORD",
1414
None,
1515
str,
16-
"The priviledged user's password to be used for storing key-values"
16+
"The priviledged user's password to be used for storing key-values",
1717
],
1818
}

omero_forms/templates/forms/forms_init.js.html

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{% load url from future %}
2-
31
<script src="{% static "forms/js/bundle.js" %}"></script>
42

53
<script>

omero_forms/urls.py

+44-56
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,70 @@
1-
from django.conf.urls import url, patterns
2-
1+
from django.conf.urls import url
32
from . import views
43

5-
urlpatterns = patterns(
6-
'django.views.generic.simple',
7-
4+
urlpatterns = [
85
# Designer App
9-
url(r'^designer/$',
10-
views.designer,
11-
name='omeroforms_designer'),
12-
6+
url(r"^designer/$", views.designer, name="omeroforms_designer"),
137
# API
14-
url(r'^$',
15-
lambda x: None,
16-
name='omeroforms_base'),
17-
8+
url(r"^$", lambda x: None, name="omeroforms_base"),
189
# List all forms
19-
url(r'^list_forms/$',
20-
views.list_forms,
21-
name='omeroforms_list_forms'),
22-
10+
url(r"^list_forms/$", views.list_forms, name="omeroforms_list_forms"),
2311
# List the forms that are assigned to the user's active group that
2412
# apply to the object type
25-
url(r'^list_applicable_forms/(?P<obj_type>\w+)/$',
13+
url(
14+
r"^list_applicable_forms/(?P<obj_type>\w+)/$",
2615
views.list_applicable_forms,
27-
name='omeroforms_list_applicable_forms'),
28-
16+
name="omeroforms_list_applicable_forms",
17+
),
2918
# Get a form (latest version)
30-
url(r'^get_form/(?P<form_id>[\w ]+)/$',
31-
views.get_form,
32-
name='omeroforms_get_form'),
33-
19+
url(r"^get_form/(?P<form_id>[\w ]+)/$", views.get_form, name="omeroforms_get_form"),
3420
# Get data for a form (latest version) for a certain object
35-
url(r'^get_form_data/'
36-
r'(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$',
21+
url(
22+
r"^get_form_data/"
23+
r"(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$",
3724
views.get_form_data,
38-
name='omeroforms_get_form_data'),
39-
25+
name="omeroforms_get_form_data",
26+
),
4027
# Get assignments (restricted to those the user can unassign)
41-
url(r'get_form_assignments/$',
28+
url(
29+
r"get_form_assignments/$",
4230
views.get_form_assignments,
43-
name='omeroforms_get_form_assignments'),
44-
31+
name="omeroforms_get_form_assignments",
32+
),
4533
# Get the entire history of a form including all data and the forms used
4634
# to enter that data
47-
url(r'^get_form_data_history/'
48-
r'(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$',
35+
url(
36+
r"^get_form_data_history/"
37+
r"(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$",
4938
views.get_form_data_history,
50-
name='omeroforms_get_form_data_history'),
51-
39+
name="omeroforms_get_form_data_history",
40+
),
5241
# Get groups that the user can manage
53-
url(r'^get_managed_groups/$',
42+
url(
43+
r"^get_managed_groups/$",
5444
views.get_managed_groups,
55-
name='omeroforms_get_managed_groups'),
56-
45+
name="omeroforms_get_managed_groups",
46+
),
5747
# Lookup usernames by uid
58-
url(r'^get_users/$',
59-
views.get_users,
60-
name='omeroforms_get_users'),
61-
48+
url(r"^get_users/$", views.get_users, name="omeroforms_get_users"),
6249
# Check form id ownership
63-
url(r'^get_formid_editable/(?P<form_id>[\w ]+)/$',
50+
url(
51+
r"^get_formid_editable/(?P<form_id>[\w ]+)/$",
6452
views.get_formid_editable,
65-
name='omeroforms_get_formid_editable'),
66-
53+
name="omeroforms_get_formid_editable",
54+
),
6755
# Save a form version (potentially a new form)
68-
url(r'^save_form/$',
69-
views.save_form,
70-
name='omeroforms_save_form'),
71-
56+
url(r"^save_form/$", views.save_form, name="omeroforms_save_form"),
7257
# Save data for a form
73-
url(r'^save_form_data/'
74-
r'(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$',
58+
url(
59+
r"^save_form_data/"
60+
r"(?P<form_id>[\w ]+)/(?P<obj_type>\w+)/(?P<obj_id>[\w ]+)/$",
7561
views.save_form_data,
76-
name='omeroforms_save_form_data'),
77-
62+
name="omeroforms_save_form_data",
63+
),
7864
# Save a form assignment
79-
url(r'^save_form_assignment/$',
65+
url(
66+
r"^save_form_assignment/$",
8067
views.save_form_assignment,
81-
name='omeroforms_save_form_assignment'),
82-
)
68+
name="omeroforms_save_form_assignment",
69+
),
70+
]

0 commit comments

Comments
 (0)