Skip to content

Commit

Permalink
Refatora métodos de views do app receitas
Browse files Browse the repository at this point in the history
  • Loading branch information
brnocesar committed Jan 27, 2021
1 parent f5f25f5 commit a3fa3d0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion apps/receitas/migrations/0002_receita_pessoa.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='receita',
name='pessoa',
# field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to='pessoas.pessoa'),
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
),
]
3 changes: 3 additions & 0 deletions apps/receitas/src/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# from .controller import *
# from .validacoes import *
# from .helper import *
2 changes: 1 addition & 1 deletion apps/receitas/views.py → apps/receitas/src/controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.shortcuts import render, get_object_or_404, redirect
from .models import Receita
from apps.receitas.models import Receita
from django.contrib.auth.models import User
from django.contrib import messages

Expand Down
13 changes: 7 additions & 6 deletions apps/receitas/urls.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from django.urls import path
from . import views
from .src.controller import *

urlpatterns = [
path('', views.index, name='receita.index'),
path('receitas/criar', views.create, name='receita.create'),
path('receitas/<int:receita_id>', views.show, name='receita.show'),
path('receitas/editar/<int:receita_id>', views.edit, name='receita.edit'),
path('receitas/deletar/<int:receita_id>', views.destroy, name='receita.destroy'),
path('', index, name='receita.index'),
path('receitas/criar', create, name='receita.create'),
path('receitas/<int:receita_id>', show, name='receita.show'),
path('receitas/editar/<int:receita_id>', edit, name='receita.edit'),
path('receitas/deletar/<int:receita_id>', destroy, name='receita.destroy'),
# rota para o campo de busca
]

0 comments on commit a3fa3d0

Please sign in to comment.