Django
1
Вклад в тег
class BookDeleteView(View):
def post(self, request, pk, *args, **kwargs):
data = dict()
book = Book.objects.get(pk=pk)
book.delete()
data['form_is_valid'] = True
context = {
'books': Book.objects.all()
}
data['html_books'] = render_to_string(
'books.html',
context
)
return JsonResponse(data)
def get(self, request, pk, *args, **kwargs):
data = dict()
book = Book.objects.get(pk=pk)
context = {
'book': book
}
data['html_book_delete_form'] = render_to_string(
'delete_book.html',
context,
request=request,
)
return JsonResponse(data)
var err error
DBGORM, err = gorm.Open("postgres", databaseURL); if err != nil {
utils.Logger().Println(err)
panic(err)
}
* */1 * * * /path/application.sh >> /path/application.log