Good Day,

As a part of a project I want to create a single page that has a number
of different utilities on it. One of those is a dice roller. Ultimately
I'd like to be able to type in the number of dice and number of sides,
click a button, and return the result on the page.

I understand you cannot pass arguments from a template without creating
custom tags (I think). So, ignore that aspect for now. 

For now, if someone could just point me in the right direction on how to
call a method from a template and return a result.

Do I want to create a view as such (assume I have a Class for making
dice rolls):

def Dice_Roll(request):
    roll = Roll(3, 8)
    total = roll.output()
    return render_to_response('utils/diceroll.html', {'total': total})

And call it from the template?
Or, am I going about this all wrong since this page doesn't have dynamic
or database data? Would a static HTML page work better? 

Ah-ha! I see I should use Flatpages, most likely. But, I'm not sure that
solves my problem since it would still use templates and would still
have to call a method.  

Thanks, and hope this wasn't too rambling,
Brian



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to