Tuesday, October 26, 2010

how to use tkinter widget in django

is it possible to use the sliderlike Scale widget from tkinter in
django?I am coding a web app where I need to get a numerical value
entered by the user.I thought ,instead of asking the user to enter a
value in a textfield ,I would provide a slider which he can move
between the minimum and maximum values.
Originally I designed the model and form like this

class MyModel(django.models.Model):
user_enrty=models.IntegerField()

class MyModelForm(django.forms.ModelForm):
class Meta:
model=MyModel

In tkinter ,I can create a scale widget like
master = Tk()
w = Scale(master, from_=0, to=100)
w.pack()
and get the current position using w.get()

How can I use this in django?Can I directly put the tkinter widget in
my model like ,
class MyModel(django.models.Model):
user_enrty=tkinter.Scale(...)

Any help would be greatly appreciated
thanks
jim


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

No comments:

Post a Comment