Path: csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'context': 0.05; "'',": 0.07; 'skip:$ 30': 0.07; 'python': 0.09; '"my': 0.09; 'exists,': 0.09; 'friday,': 0.09; 'skip:$ 50': 0.09; 'def': 0.10; 'skip:# 20': 0.13; 'skip:p 40': 0.15; '();': 0.16; 'newsgroups:': 0.16; 'skip:u 60': 0.16; '31,': 0.22; 'received:mail- bk0-f46.google.com': 0.22; 'skip:$ 20': 0.22; 'x-mailer:microsoft outlook express 6.00.2900.5931': 0.22; 'script': 0.24; 'skip:# 10': 0.27; 'received:209.85.214.46': 0.27; 'skip:e 30': 0.27; 'skip:( 20': 0.28; 'perl': 0.29; 'url:mailman': 0.29; 'maybe': 0.29; "skip:' 10": 0.30; 'point': 0.31; 'url:python': 0.32; '-----': 0.32; 'print': 0.32; 'url:listinfo': 0.32; 'skip:s 30': 0.33; 'like:': 0.33; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'entered': 0.34; 'path': 0.35; 'skip:f 40': 0.35; 'skip:l 30': 0.35; 'continue': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'skip:{ 10': 0.36; "didn't": 0.36; 'should': 0.36; 'thank': 0.36; 'skip:p 20': 0.36; 'skip:t 40': 0.37; 'sent:': 0.37; 'received:209': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'skip:( 30': 0.38; 'store': 0.38; 'from:': 0.38; 'object': 0.38; 'login': 0.38; 'to:addr:python.org': 0.39; 'received:209.85.214': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'url:mail': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'profile': 0.61; 'hear': 0.63; 'forward': 0.66; 'skip:$ 10': 0.66; 'august': 0.66; 'soon': 0.70; 'hey,': 0.72; 'received:82.137': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:references:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :x-mailer:x-mimeole; bh=ls/eiG/gBcUKhLv8tm7+Mj3UITX7yFtGwnJTr/5EuoA=; b=dLCU3rjrHPS2Frr7WW0vUtME1W6ub3wqfa+f49Imv9921c7KO83jWNApLs++LwbG2u 5Xy1lNWJRMSpr7kwfjfwsaICOdfK32cCL7SmRFZxCO5VcEQuAOuKr3G1rEOOeqxyOrAA yATasaXToOg3UPZ/SB9t3IuURlhEGDaXz0OQR61Ys/LU3fAK5W6RoG4J8gP9u4H82lv5 bfdJOTb6Uh7WIP0SWrg62jYUr1t6UT2J5r1Xc83ddCrgluy8loj2o8DduZLZV6C0P4YM 3wIdHp5MuUBO5AhnAPnE5SnILWhtT8CJNSB4vmkFu7h66cVlmNnG1LMSNRj91aaV1YOU GN2w== From: "Octavian Rasnita" To: References: <407771a5-0b1f-4bb6-8548-e5f79908b43d@googlegroups.com> Subject: Re: Call perl to store data in DB Date: Fri, 31 Aug 2012 12:19:21 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 127 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346404771 news.xs4all.nl 6898 [2001:888:2000:d::a6]:60580 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28163 Maybe I didn't understand well, but if you want your Perl program to get = and store the data submitted by the form, then the action of the form = should point to the Perl script something like:
So your "form" object in Python should set the action as the path to the = Perl program. --Octavian ----- Original Message -----=20 From: "Mulla" Newsgroups: comp.lang.python To: Sent: Friday, August 31, 2012 11:40 AM Subject: Call perl to store data in DB > hey, >=20 > when i submit the form in html , the entered data = (fname,lanme,uname.....)all have to come in perl script to store that = data in DB. >=20 >=20 > Python View.py >=20 >=20 > def ProfileRegistration(request): > if request.user.is_authenticated(): > return HttpResponseRedirect('/profile/') > if request.method =3D=3D 'POST': > form =3D RegistrationForm(data=3Drequest.POST, = files=3Drequest.FILES) > if form.is_bound and form.is_valid(): > user =3D = User.objects.create_user(username=3Dform.cleaned_data['username'], > = email=3Dform.cleaned_data['email'], > = password=3Dform.cleaned_data['password'],) > new_user=3D user.save() > profile =3D = Profile(user=3Duser,firstname=3Dform.cleaned_data['firstname'], > lastname=3Dform.cleaned_data['lastname'], > = telephone=3Dform.cleaned_data['telephone'], > service=3Dform.cleaned_data['service'], > = servicetype=3Dform.cleaned_data['servicetype'],) > new_user =3D profile.save() > # messages.info(request, "Thank you for registration.Please = login to continue") > # login(request, new_user) > return HttpResponseRedirect('/dashboard/') > else: > return render_to_response('register.html',{'form': = form},context_instance=3DRequestContext(request)) > else: > form =3D RegistrationForm() > context =3D {'form':form} > return render_to_response('register.html',context, = context_instance=3DRequestContext(request)) >=20 > Below in my perl script=20 >=20 >=20 > #!/usr/bin/perl >=20 > use strict; > use warnings; > use user; >=20 >=20 >=20 > my $tempuser =3D new user (); >=20 > if ($tempuser->readbyfirstname('Pervez') eq 1) { > # Continue processing since we found a match > if($tempuser->{lastname} eq 'Noel') > { > print "Name already exists, \n"; > } > } >=20 > my $tempuser1 =3D new user(); > $tempuser1->readbyemail_id('mullapervez@gmail.com');=20 > if($tempuser1->{email_id} eq 'mullapervez@gmail.com') > { > print "email_id is in use \n"; > } > =20 >=20 >=20 > my $tempuser2 =3D new user(); > $tempuser2->readbyusername('Tim_sir'); > if ($tempuser2->{username} eq 'Mulla')=20 > { > print "username is already present\n"; > } > else { > print "we have no match\n"; > } >=20 > my $tempuser4 =3D new user('pervez', '', 'mulla', = 'mullapervez@gmail.com', '193274198'); > my $string =3D $tempuser4->{firstname}; > my @c =3D split(//, $string); > my $userhash =3D "00$c[0]$c[-1]"; > print "$userhash \n"; > #$tempuser4->{userhash} =3D $userhash; > $tempuser4->setuserhash( "$userhash" ); > $tempuser4->write; > =20 > =20 > when I submit data , that data must come in place "my $tempuser4 =3D = new user('pervez', '', 'mulla', 'mullapervez@gmail.com', '193274198');" = ... >=20 > how can I do this ...>>? >=20 > Look forward for hear from you soon >=20 > Thank You > --=20 > http://mail.python.org/mailman/listinfo/python-list