diff --git a/multigranja/apps/entities/services/animal.py b/multigranja/apps/entities/services/animal.py index 756edce..b3c6dfc 100644 --- a/multigranja/apps/entities/services/animal.py +++ b/multigranja/apps/entities/services/animal.py @@ -26,7 +26,7 @@ def _get_batch_by_id(request, batch_id): return get_object_or_404(Batch, pk=batch_id, is_active=True) # Animal Services -def get_animal_new_context(): +def get_animal_create_context(): form = AnimalCreateForm() context = {} @@ -91,7 +91,7 @@ def delete_animal(request, animal_id): # Batch Services -def get_batch_new_context(request): +def get_batch_create_context(request): form = BatchForm() form.fields['animals'].queryset = _get_farms_active_animals(request) diff --git a/multigranja/apps/entities/services/farm.py b/multigranja/apps/entities/services/farm.py index 8ab561c..6a8d97c 100644 --- a/multigranja/apps/entities/services/farm.py +++ b/multigranja/apps/entities/services/farm.py @@ -27,7 +27,7 @@ def get_farm_home_context(request): return context -def get_farm_new_context(): +def get_farm_create_context(): form = FarmCreateForm() context = {} diff --git a/multigranja/apps/entities/templates/animal/animal_new.html b/multigranja/apps/entities/templates/animal/animal_create.html similarity index 100% rename from multigranja/apps/entities/templates/animal/animal_new.html rename to multigranja/apps/entities/templates/animal/animal_create.html diff --git a/multigranja/apps/entities/templates/batch/batch_new.html b/multigranja/apps/entities/templates/batch/batch_create.html similarity index 100% rename from multigranja/apps/entities/templates/batch/batch_new.html rename to multigranja/apps/entities/templates/batch/batch_create.html diff --git a/multigranja/apps/entities/templates/farm/farm_new.html b/multigranja/apps/entities/templates/farm/farm_create.html similarity index 100% rename from multigranja/apps/entities/templates/farm/farm_new.html rename to multigranja/apps/entities/templates/farm/farm_create.html diff --git a/multigranja/apps/entities/templates/paddock/paddock_new.html b/multigranja/apps/entities/templates/paddock/paddock_create.html similarity index 100% rename from multigranja/apps/entities/templates/paddock/paddock_new.html rename to multigranja/apps/entities/templates/paddock/paddock_create.html diff --git a/multigranja/apps/entities/templates/paddock_group/paddock_group_new.html b/multigranja/apps/entities/templates/paddock_group/paddock_group_create.html similarity index 100% rename from multigranja/apps/entities/templates/paddock_group/paddock_group_new.html rename to multigranja/apps/entities/templates/paddock_group/paddock_group_create.html diff --git a/multigranja/apps/entities/templates/rotation/rotation_new.html b/multigranja/apps/entities/templates/rotation/rotation_create.html similarity index 100% rename from multigranja/apps/entities/templates/rotation/rotation_new.html rename to multigranja/apps/entities/templates/rotation/rotation_create.html diff --git a/multigranja/apps/entities/urls/animal.py b/multigranja/apps/entities/urls/animal.py index 75be8ed..1629998 100644 --- a/multigranja/apps/entities/urls/animal.py +++ b/multigranja/apps/entities/urls/animal.py @@ -8,11 +8,11 @@ urlpatterns = [ path('list/', AnimalListView.as_view(), name='animal_list'), path('batch/list/', BatchListView.as_view(), name='batch_list'), - path('new/', views.animal_new, name='animal_create'), + path('create/', views.animal_create, name='animal_create'), path('update/', views.animal_update, name='animal_update'), path('delete/', views.animal_delete, name='animal_delete'), - path('batch/new/', views.batch_new, name='batch_create'), + path('batch/create/', views.batch_create, name='batch_create'), path('batch/update/', views.batch_update, name='batch_update'), path('batch/delete/', views.batch_delete, name='batch_delete'), ] \ No newline at end of file diff --git a/multigranja/apps/entities/urls/farm.py b/multigranja/apps/entities/urls/farm.py index 171776f..8a90ee3 100644 --- a/multigranja/apps/entities/urls/farm.py +++ b/multigranja/apps/entities/urls/farm.py @@ -9,15 +9,15 @@ urlpatterns = [ path('paddock/list/', PaddockListView.as_view(), name='paddock_list'), path('paddock/group/list/', PaddockGroupListView.as_view(), name='paddock_group_list'), - path('new/', views.farm_new, name='farm_create'), + path('create/', views.farm_create, name='farm_create'), path('update/', views.farm_update, name='farm_update'), path('delete/', views.farm_delete, name='farm_delete'), - path('paddock/new/', views.paddock_new, name='paddock_create'), + path('paddock/create/', views.paddock_create, name='paddock_create'), path('paddock/update/', views.paddock_update, name='paddock_update'), path('paddock/delete/', views.paddock_delete, name='paddock_delete'), - path('paddock_group/new/', views.paddock_group_new, name='paddock_group_create'), + path('paddock_group/create/', views.paddock_group_create, name='paddock_group_create'), path('paddock_group/update/', views.paddock_group_update, name='paddock_group_update'), path('paddock_group/delete/', views.paddock_group_delete, name='paddock_group_delete'), ] \ No newline at end of file diff --git a/multigranja/apps/entities/urls/rotation.py b/multigranja/apps/entities/urls/rotation.py index 4a64065..5b78e13 100644 --- a/multigranja/apps/entities/urls/rotation.py +++ b/multigranja/apps/entities/urls/rotation.py @@ -8,6 +8,6 @@ app_name = 'rotation' urlpatterns = [ path('', RotationListView.as_view(), name='rotation_home'), - path('new/', views.rotation_create, name='rotation_create'), + path('create/', views.rotation_create, name='rotation_create'), path('delete/', views.rotation_delete, name='rotation_delete'), ] \ No newline at end of file diff --git a/multigranja/apps/entities/views/animal.py b/multigranja/apps/entities/views/animal.py index da72356..2dc4555 100644 --- a/multigranja/apps/entities/views/animal.py +++ b/multigranja/apps/entities/views/animal.py @@ -6,16 +6,16 @@ from ..services import animal as services # Animal Views @farm_required -def animal_new(request): - context = services.get_animal_new_context() +def animal_create(request): + context = services.get_animal_create_context() if request.method == 'GET': - return render(request, 'animal/animal_new.html', context) + return render(request, 'animal/animal_create.html', context) if request.method == 'POST': if services.create_animal(request): return redirect('entities:animal:animal_list') context['error'] = "Não foi possível registrar o animal" - return render(request, 'animal/animal_new.html', context) + return render(request, 'animal/animal_create.html', context) @farm_required @@ -45,16 +45,16 @@ def animal_delete(request, animal_id): # Batch Views @farm_required -def batch_new(request): - context = services.get_batch_new_context(request) +def batch_create(request): + context = services.get_batch_create_context(request) if request.method == 'GET': - return render(request, 'batch/batch_new.html', context) + return render(request, 'batch/batch_create.html', context) if request.method == 'POST': if services.create_batch(request): return redirect('entities:animal:batch_list') context['error'] = "Não foi possível criar o lote" - return render(request, 'batch/batch_new.html', context) + return render(request, 'batch/batch_create.html', context) @farm_required diff --git a/multigranja/apps/entities/views/farm.py b/multigranja/apps/entities/views/farm.py index f284286..b18a157 100644 --- a/multigranja/apps/entities/views/farm.py +++ b/multigranja/apps/entities/views/farm.py @@ -11,10 +11,10 @@ def farm_home(request): @farm_required -def farm_new(request): +def farm_create(request): if request.method == 'GET': - context = services.get_farm_new_context() - return render(request, 'farm/farm_new.html', context) + context = services.get_farm_create_context() + return render(request, 'farm/farm_create.html', context) elif request.method == 'POST': success = services.create_farm(request) @@ -44,10 +44,10 @@ def farm_delete(request, farm_id): # Paddock Views @farm_required -def paddock_new(request): +def paddock_create(request): if request.method == 'GET': - context = services.get_paddock_new_context() - return render(request, 'paddock/paddock_new.html', context) + context = services.get_paddock_create_context() + return render(request, 'paddock/paddock_create.html', context) elif request.method == 'POST': success = services.create_paddock(request) @@ -77,10 +77,10 @@ def paddock_delete(request, paddock_id): # Paddock Group Views @farm_required -def paddock_group_new(request): +def paddock_group_create(request): if request.method == 'GET': - context = services.get_paddock_group_new_context() - return render(request, 'paddock_group/paddock_group_new.html', context) + context = services.get_paddock_group_create_context() + return render(request, 'paddock_group/paddock_group_create.html', context) elif request.method == 'POST': success = services.create_paddock_group(request) diff --git a/multigranja/apps/entities/views/rotation.py b/multigranja/apps/entities/views/rotation.py index 9737840..5aafa95 100644 --- a/multigranja/apps/entities/views/rotation.py +++ b/multigranja/apps/entities/views/rotation.py @@ -7,7 +7,7 @@ def rotation_home(request): @farm_required def rotation_create(request): - return render(request, 'rotation/rotation_new.html') + return render(request, 'rotation/rotation_create.html') @farm_required def rotation_delete(request):