forked from enviPath/enviPy
[Misc] Performance improvements, SMIRKS Coverage, Minor Bugfixes (#132)
Bump Python Version to 3.12 Make use of "epauth" optional Cache `srs` property of rules to speed up apply Adjust view names for use of `reverse()` Fix Views for Scenario Attachments Added Simply Compare View/Template to identify differences between rdkit and ambit Make migrations consistent with tests + compare Fixes #76 Set default year for Scenario Modal Fix html tags for package description Added Tests for Pathway / Rule Added remove stereo for apply Co-authored-by: Tim Lorsbach <tim@lorsba.ch> Reviewed-on: enviPath/enviPy#132
This commit is contained in:
@ -1101,7 +1101,7 @@ class ParallelRule(Rule):
|
||||
def _url(self):
|
||||
return '{}/parallel-rule/{}'.format(self.package.url, self.uuid)
|
||||
|
||||
@property
|
||||
@cached_property
|
||||
def srs(self) -> QuerySet:
|
||||
return self.simple_rules.all()
|
||||
|
||||
|
||||
@ -48,10 +48,10 @@ urlpatterns = [
|
||||
# User Detail
|
||||
re_path(rf'^user/(?P<user_uuid>{UUID})', v.user, name='user'),
|
||||
# Group Detail
|
||||
re_path(rf'^group/(?P<group_uuid>{UUID})$', v.group, name='group_detail'),
|
||||
re_path(rf'^group/(?P<group_uuid>{UUID})$', v.group, name='group detail'),
|
||||
|
||||
# "in package" urls
|
||||
re_path(rf'^package/(?P<package_uuid>{UUID})$', v.package, name='package_detail'),
|
||||
re_path(rf'^package/(?P<package_uuid>{UUID})$', v.package, name='package detail'),
|
||||
# Compound
|
||||
re_path(rf'^package/(?P<package_uuid>{UUID})/compound$', v.package_compounds, name='package compound list'),
|
||||
re_path(rf'^package/(?P<package_uuid>{UUID})/compound/(?P<compound_uuid>{UUID})$', v.package_compound, name='package compound detail'),
|
||||
|
||||
@ -870,7 +870,7 @@ def package(request, package_uuid):
|
||||
object_to_copy = request.POST.get('object_to_copy')
|
||||
|
||||
if not object_to_copy:
|
||||
return error(request, 'Invalid target package.', 'Please select a target package.')
|
||||
return error(request, 'No object to copy', 'There was no object to copy.')
|
||||
|
||||
copied_object = copy_object(current_user, current_package, object_to_copy)
|
||||
return JsonResponse({'success': copied_object.url})
|
||||
@ -1019,7 +1019,7 @@ def package_compound(request, package_uuid, compound_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_compound, selected_scenarios)
|
||||
return redirect(current_compound.url)
|
||||
|
||||
@ -1128,7 +1128,7 @@ def package_compound_structure(request, package_uuid, compound_uuid, structure_u
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_structure, selected_scenarios)
|
||||
return redirect(current_structure.url)
|
||||
|
||||
@ -1255,7 +1255,7 @@ def package_rule(request, package_uuid, rule_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_rule, selected_scenarios)
|
||||
return redirect(current_rule.url)
|
||||
|
||||
@ -1358,7 +1358,7 @@ def package_reaction(request, package_uuid, reaction_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_reaction, selected_scenarios)
|
||||
return redirect(current_reaction.url)
|
||||
|
||||
@ -1545,7 +1545,7 @@ def package_pathway(request, package_uuid, pathway_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_pathway, selected_scenarios)
|
||||
return redirect(current_pathway.url)
|
||||
|
||||
@ -1691,7 +1691,7 @@ def package_pathway_node(request, package_uuid, pathway_uuid, node_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_node, selected_scenarios)
|
||||
return redirect(current_node.url)
|
||||
|
||||
@ -1800,7 +1800,7 @@ def package_pathway_edge(request, package_uuid, pathway_uuid, edge_uuid):
|
||||
|
||||
selected_scenarios = request.POST.getlist('selected-scenarios')
|
||||
|
||||
if selected_scenarios:
|
||||
if selected_scenarios is not None:
|
||||
set_scenarios(current_user, current_edge, selected_scenarios)
|
||||
return redirect(current_edge.url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user