We need to see more of the template.

You do know, for example, that you must provide your own form html tag?
as_form only renders the input and select tags.

Also, why do you think that your form constructor takes a "temsilci" keyword
argument?  Have you a custom __init__ that peels it out for something?

Bill



On Sat, Apr 3, 2010 at 6:22 AM, H.İbrahim Yılmaz <prehisto...@gmail.com> wrote:
> Hi all,
> I change my view as below but, show no Form...
>
> from django.shortcuts import render_to_response
> from django import forms
> from yenicrm.musteri.models import *
> from yenicrm.ziyaret.models import *
> from django.contrib.auth.decorators import login_required
> from django.template import Context, RequestContext
> from django.http import HttpResponse
>
> @login_required
> def index(request):
>    ziyaretler = Ziyaret.objects.filter(temsilci = request.user)
>    return render_to_response('ziyaret.html', {'ziyaretler': ziyaretler})
>
> @login_required
> def ziyaret_ekle(request):
>    if request.POST:
>        zform = ZiyaretForm(request.POST, temsilci = request.user)
>        if form.is_valid():
>            yeni_ziyaret_objesi = form.save(commit = False)
>            yeni_ziyaret_objesi.temsilci = request.user
>            yeni_ziyaret_objesi.save()
>            return HttpResponse("Veritabanina kaydedildi. Yeni
> ziyaretin id'si : %d" % yeni_ziyaret_objesi.pk)
>    return render_to_response('ziyaret_kaydet.html', {'zform':
> ZiyaretForm(temsilci = request.user)},
> context_instance=RequestContext(request))
>
> 2010/4/3 Daniel Roseman <dan...@roseman.org.uk>:
>> On Apr 3, 10:09 am, H.İbrahim Yılmaz <prehisto...@gmail.com> wrote:
>>> Any help please?
>>
>> Bill gave you the answer two messages ago:
>>
>>> > 02 Nisan 2010 20:43 tarihinde Bill Freeman <ke1g...@gmail.com> yazdý:
>>> >> You are discarding the result of your first render_to_response and 
>>> >> displaying
>>> >> the second, which is always an empty form (except when the form is valid,
>>> >> when you are returning an HttpResponse.  You probably meant to put a
>>> >> return in front of that render_to_response as well.
>>
>> --
>> 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.
>>
>>
>
>
>
> --
> http://www.arkeoloji.web.tr
>
> --
> 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.
>
>

-- 
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