Re: help error in form usage

2011-08-18 Thread Derek
The Django Book is a useful general introduction; but now more than 2 years old. In a framework like Django, which is under constant development, such old information gets out-of-date very fast. Tom correctly pointed you to the docs; and that is really the best place to work from now that you are

Re: help error in form usage

2011-08-16 Thread Phang Mulianto
Oh i see.. i read the manual, the django book, no such information about that.. oh my..better update the manual there.. thanks for your quick explanation then, i think not a good way to manualy assign a dictionarry to the form, not like in the documentation / book of django. now i get it. Thanks

Re: help error in form usage

2011-08-16 Thread Tom Evans
Your form is not a model form, and so you cannot pass instance=post. Since it is just a regular form, you should pass a dictionary of values, with the keys of the dictionary being the names of the fields. If the form is representing a model, you should be using a model form. https://docs.djangopr

Re: help error in form usage

2011-08-16 Thread Phang Mulianto
hi anyone can help me... On Mon, Aug 15, 2011 at 12:39 PM, Phang Mulianto wrote: > Hi Daniel, > > i change it to instance, but still got other errors : > > > def myadmin_change_post(request, > template_name='blog/admin/change_post.html'): > try: > id= request.GET.get('id','4') > e

Re: help error in form usage

2011-08-14 Thread Phang Mulianto
Hi Daniel, i change it to instance, but still got other errors : def myadmin_change_post(request, template_name='blog/admin/change_post.html'): try: id= request.GET.get('id','4') except ValueError: id=1 #post = get_object_or_404(Post,pk=id) post = Post.objects.get(

Re: help error in form usage

2011-08-14 Thread Daniel Roseman
This line: form = AdminPostForm(initial=post)* * should be form = AdminPostForm(instance=post) -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-use

help error in form usage

2011-08-14 Thread Phang Mulianto
hi..need help.. Here are the model : class Post(models.Model): title = models.CharField(max_length=200) content = models.TextField() slug = models.SlugField(max_length=50, unique=True, help_text='Unique Value for Article page URL, created from title.') is_publish = models.Boolean