how to delete a record?

2 views
Skip to first unread message

inhahe

unread,
Dec 23, 2008, 6:04:19 AM12/23/08
to mako-d...@googlegroups.com
Can someone tell me how to delete a record using Mako? Do I have to
use SQL for this?? Thanks.

Jose Galvez

unread,
Dec 23, 2008, 6:56:53 PM12/23/08
to mako-d...@googlegroups.com
the general answer is yes you would have to use an sql statement to
delete a record. Mako is a template language designed to render other
code such as html, but it is certainly not limited to html. Withing the
template you can include random python code which could render an sql
statement to delete a record
Jose

mk

unread,
Jan 9, 2009, 7:54:09 AM1/9/09
to Mako Templates for Python


On Dec 23 2008, 12:04 pm, inhahe <inh...@gmail.com> wrote:
> Can someone tell me how to delete a record using Mako? Do I have to
> use SQL for this?? Thanks.

That's kind of like asking "how to make flat iron fly?" :-) The answer
is if you really try, you could conceivably do this, but the bigger
point is, you should do it in Controller code, not View code (look up
MVC on Wikipedia). Another answer is, no, you don't need to use SQL to
delete a record provided you use Object-Relational Mapper like
SQLAlchemy.

Regards,
mk

Isaac Csandl

unread,
Jan 15, 2009, 6:18:03 PM1/15/09
to Mako Templates for Python


On Jan 9, 6:54 am, mk <mrk...@gmail.com> wrote:
> On Dec 23 2008, 12:04 pm, inhahe <inh...@gmail.com> wrote:
>
> > Can someone tell me how to delete a record using Mako?  Do I have to
> > use SQL for this??  Thanks.

You could, but it's such a bad idea that I refuse to tell you how! ;)

(as mk said, do it in a controller)

--isaac
Reply all
Reply to author
Forward
0 new messages