Задать вопрос

Тел: +7 965 3737 888

501

Просмотров

0

Ответов

Django Using Stored Procedure

Here is an clean example of using stored procedure using django. It sounds pretty weird "stored procedures in django" but for legacy database system we still need a clean approach to implement stored procedures using django.

In this example, I've implemented logic inside models.py by creating a dummy class, i.e a django table (which is comparable to package in your database) and inside this package/class i added stored procedure wrappers. I tested it with boulder-oracle-sprint branch, there is minor issues with LazyDate in db/backend/oracle/base.py but it still working after minor edits in base.py. It worked absolutely fine with MySQL and MSSQL.

View is pretty straight forward. Dont forget to create form.html as template and in body just put {{ form }}

Вопрос полезен? Да0/Нет0
file_3858.py(1.3Кб)
None