Compensation app url reorganizing
* restructures urls into separate xy_urls files which are included inside of compensation/urls.py * adds default ordering of Payment by .amount
This commit is contained in:
		
							parent
							
								
									9b2aaaa5fa
								
							
						
					
					
						commit
						dac334ed14
					
				
							
								
								
									
										31
									
								
								compensation/account_urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								compensation/account_urls.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
					Author: Michel Peltriaux
 | 
				
			||||||
 | 
					Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
 | 
				
			||||||
 | 
					Contact: michel.peltriaux@sgdnord.rlp.de
 | 
				
			||||||
 | 
					Created on: 24.08.21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					from django.urls import path
 | 
				
			||||||
 | 
					from compensation.views.eco_account_views import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					urlpatterns = [
 | 
				
			||||||
 | 
					    path("", index_view, name="acc-index"),
 | 
				
			||||||
 | 
					    path('new/', new_view, name='acc-new'),
 | 
				
			||||||
 | 
					    path('<id>', open_view, name='acc-open'),
 | 
				
			||||||
 | 
					    path('<id>/log', log_view, name='acc-log'),
 | 
				
			||||||
 | 
					    path('<id>/record', record_view, name='acc-record'),
 | 
				
			||||||
 | 
					    path('<id>/edit', edit_view, name='acc-edit'),
 | 
				
			||||||
 | 
					    path('<id>/remove', remove_view, name='acc-remove'),
 | 
				
			||||||
 | 
					    path('<id>/state/new', state_new_view, name='acc-new-state'),
 | 
				
			||||||
 | 
					    path('<id>/action/new', action_new_view, name='acc-new-action'),
 | 
				
			||||||
 | 
					    path('<id>/deadline/new', deadline_new_view, name="acc-new-deadline"),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Documents
 | 
				
			||||||
 | 
					    # Document remove route can be found in konova/urls.py
 | 
				
			||||||
 | 
					    path('<id>/document/new/', new_document_view, name='acc-new-doc'),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Eco-account withdraws
 | 
				
			||||||
 | 
					    path('<id>/remove/<withdraw_id>', withdraw_remove_view, name='withdraw-remove'),
 | 
				
			||||||
 | 
					    path('<id>/withdraw/new', new_withdraw_view, name='acc-new-withdraw'),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
							
								
								
									
										33
									
								
								compensation/comp_urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								compensation/comp_urls.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,33 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
					Author: Michel Peltriaux
 | 
				
			||||||
 | 
					Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
 | 
				
			||||||
 | 
					Contact: michel.peltriaux@sgdnord.rlp.de
 | 
				
			||||||
 | 
					Created on: 24.08.21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					from django.urls import path
 | 
				
			||||||
 | 
					from compensation.views.compensation_views import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					urlpatterns = [
 | 
				
			||||||
 | 
					    # Main compensation
 | 
				
			||||||
 | 
					    path("", index_view, name="index"),
 | 
				
			||||||
 | 
					    path('new', new_view, name='new'),
 | 
				
			||||||
 | 
					    path('<id>', open_view, name='open'),
 | 
				
			||||||
 | 
					    path('<id>/log', log_view, name='log'),
 | 
				
			||||||
 | 
					    path('<id>/edit', edit_view, name='edit'),
 | 
				
			||||||
 | 
					    path('<id>/remove', remove_view, name='remove'),
 | 
				
			||||||
 | 
					    path('<id>/state/new', state_new_view, name='new-state'),
 | 
				
			||||||
 | 
					    path('<id>/action/new', action_new_view, name='new-action'),
 | 
				
			||||||
 | 
					    path('<id>/deadline/new', deadline_new_view, name="new-deadline"),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Documents
 | 
				
			||||||
 | 
					    # Document remove route can be found in konova/urls.py
 | 
				
			||||||
 | 
					    path('<id>/document/new/', new_document_view, name='new-doc'),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Generic state routes
 | 
				
			||||||
 | 
					    path('state/<id>/remove', state_remove_view, name='state-remove'),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Generic action routes
 | 
				
			||||||
 | 
					    path('action/<id>/remove', action_remove_view, name='action-remove'),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
@ -38,6 +38,11 @@ class Payment(BaseResource):
 | 
				
			|||||||
        related_name='payments'
 | 
					        related_name='payments'
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    class Meta:
 | 
				
			||||||
 | 
					        ordering = [
 | 
				
			||||||
 | 
					            "-amount",
 | 
				
			||||||
 | 
					        ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CompensationState(UuidModel):
 | 
					class CompensationState(UuidModel):
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										14
									
								
								compensation/payment_urls.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								compensation/payment_urls.py
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					"""
 | 
				
			||||||
 | 
					Author: Michel Peltriaux
 | 
				
			||||||
 | 
					Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
 | 
				
			||||||
 | 
					Contact: michel.peltriaux@sgdnord.rlp.de
 | 
				
			||||||
 | 
					Created on: 24.08.21
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					"""
 | 
				
			||||||
 | 
					from django.urls import path
 | 
				
			||||||
 | 
					from compensation.views.payment_views import *
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					urlpatterns = [
 | 
				
			||||||
 | 
					    path('<intervention_id>/new', new_payment_view, name='pay-new'),
 | 
				
			||||||
 | 
					    path('<id>/remove', payment_remove_view, name='pay-remove'),
 | 
				
			||||||
 | 
					]
 | 
				
			||||||
@ -5,64 +5,11 @@ Contact: michel.peltriaux@sgdnord.rlp.de
 | 
				
			|||||||
Created on: 30.11.20
 | 
					Created on: 30.11.20
 | 
				
			||||||
 | 
					
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
from django.urls import path
 | 
					from django.urls import path, include
 | 
				
			||||||
 | 
					 | 
				
			||||||
from compensation.views import compensation_views
 | 
					 | 
				
			||||||
from compensation.views import payment_views
 | 
					 | 
				
			||||||
from compensation.views import eco_account_views
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
app_name = "compensation"
 | 
					app_name = "compensation"
 | 
				
			||||||
 | 
					urlpatterns = [
 | 
				
			||||||
# Split lists for each sub-component for better overview
 | 
					    path("", include("compensation.comp_urls")),
 | 
				
			||||||
urlpatterns_payment = [
 | 
					    path("acc/", include("compensation.account_urls")),
 | 
				
			||||||
    path('pay/<intervention_id>/new', payment_views.new_payment_view, name='pay-new'),
 | 
					    path("pay/", include("compensation.payment_urls")),
 | 
				
			||||||
    path('pay/<id>/remove', payment_views.payment_remove_view, name='pay-remove'),
 | 
					]
 | 
				
			||||||
]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
urlaptterns_eco_acc = [
 | 
					 | 
				
			||||||
    path("acc/", eco_account_views.index_view, name="acc-index"),
 | 
					 | 
				
			||||||
    path('acc/new/', eco_account_views.new_view, name='acc-new'),
 | 
					 | 
				
			||||||
    path('acc/<id>', eco_account_views.open_view, name='acc-open'),
 | 
					 | 
				
			||||||
    path('acc/<id>/log', eco_account_views.log_view, name='acc-log'),
 | 
					 | 
				
			||||||
    path('acc/<id>/record', eco_account_views.record_view, name='acc-record'),
 | 
					 | 
				
			||||||
    path('acc/<id>/edit', eco_account_views.edit_view, name='acc-edit'),
 | 
					 | 
				
			||||||
    path('acc/<id>/remove', eco_account_views.remove_view, name='acc-remove'),
 | 
					 | 
				
			||||||
    path('acc/<id>/state/new', eco_account_views.state_new_view, name='acc-new-state'),
 | 
					 | 
				
			||||||
    path('acc/<id>/action/new', eco_account_views.action_new_view, name='acc-new-action'),
 | 
					 | 
				
			||||||
    path('acc/<id>/deadline/new', eco_account_views.deadline_new_view, name="acc-new-deadline"),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Documents
 | 
					 | 
				
			||||||
    # Document remove route can be found in konova/urls.py
 | 
					 | 
				
			||||||
    path('acc/<id>/document/new/', eco_account_views.new_document_view, name='acc-new-doc'),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Eco-account withdraws
 | 
					 | 
				
			||||||
    path('acc/<id>/remove/<withdraw_id>', eco_account_views.withdraw_remove_view, name='withdraw-remove'),
 | 
					 | 
				
			||||||
    path('acc/<id>/withdraw/new', eco_account_views.new_withdraw_view, name='acc-new-withdraw'),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
]
 | 
					 | 
				
			||||||
urlpatterns_compensation = [
 | 
					 | 
				
			||||||
    # Main compensation
 | 
					 | 
				
			||||||
    path("", compensation_views.index_view, name="index"),
 | 
					 | 
				
			||||||
    path('new', compensation_views.new_view, name='new'),
 | 
					 | 
				
			||||||
    path('<id>', compensation_views.open_view, name='open'),
 | 
					 | 
				
			||||||
    path('<id>/log', compensation_views.log_view, name='log'),
 | 
					 | 
				
			||||||
    path('<id>/edit', compensation_views.edit_view, name='edit'),
 | 
					 | 
				
			||||||
    path('<id>/remove', compensation_views.remove_view, name='remove'),
 | 
					 | 
				
			||||||
    path('<id>/state/new', compensation_views.state_new_view, name='new-state'),
 | 
					 | 
				
			||||||
    path('<id>/action/new', compensation_views.action_new_view, name='new-action'),
 | 
					 | 
				
			||||||
    path('<id>/deadline/new', compensation_views.deadline_new_view, name="new-deadline"),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Documents
 | 
					 | 
				
			||||||
    # Document remove route can be found in konova/urls.py
 | 
					 | 
				
			||||||
    path('<id>/document/new/', compensation_views.new_document_view, name='new-doc'),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Generic state routes
 | 
					 | 
				
			||||||
    path('state/<id>/remove', compensation_views.state_remove_view, name='state-remove'),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Generic action routes
 | 
					 | 
				
			||||||
    path('action/<id>/remove', compensation_views.action_remove_view, name='action-remove'),
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Merge all together in the end
 | 
					 | 
				
			||||||
urlpatterns = urlpatterns_compensation + urlaptterns_eco_acc + urlpatterns_payment
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user