Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28163

Re: Call perl to store data in DB

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 <orasnita@gmail.com>
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" <orasnita@gmail.com>
To <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4002.1346404771.4697.python-list@python.org> (permalink)
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

Show key headers only | View raw


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:

<form action="/path/to/your/Perl/script.pl" method="post">

So your "form" object in Python should set the action as the path to the Perl program.

--Octavian

----- Original Message ----- 
From: "Mulla" <mullapervez@gmail.com>
Newsgroups: comp.lang.python
To: <python-list@python.org>
Sent: Friday, August 31, 2012 11:40 AM
Subject: Call perl to store data in DB


> hey,
> 
> 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.
> 
> 
> Python View.py
> 
> 
> def ProfileRegistration(request):
>    if request.user.is_authenticated():
>        return HttpResponseRedirect('/profile/')
>    if request.method == 'POST':
>        form = RegistrationForm(data=request.POST, files=request.FILES)
>        if form.is_bound and form.is_valid():
>            user = User.objects.create_user(username=form.cleaned_data['username'],
>                                            email=form.cleaned_data['email'],
>                                            password=form.cleaned_data['password'],)
>            new_user= user.save()
>            profile = Profile(user=user,firstname=form.cleaned_data['firstname'],
>                              lastname=form.cleaned_data['lastname'],
>                              telephone=form.cleaned_data['telephone'],
>                              service=form.cleaned_data['service'],
>                              servicetype=form.cleaned_data['servicetype'],)
>            new_user = 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=RequestContext(request))
>    else:
>        form = RegistrationForm()
>        context = {'form':form}
>        return render_to_response('register.html',context, context_instance=RequestContext(request))
> 
> Below in my perl script 
> 
> 
> #!/usr/bin/perl
> 
> use strict;
> use warnings;
> use user;
> 
> 
> 
> my $tempuser = new user ();
> 
> if ($tempuser->readbyfirstname('Pervez') eq 1) {
> # Continue processing since we found a match
>     if($tempuser->{lastname} eq 'Noel')
>                        {
>                        print "Name already exists, \n";
>                        }
> }
> 
> my $tempuser1 = new user();
> $tempuser1->readbyemail_id('mullapervez@gmail.com'); 
>    if($tempuser1->{email_id} eq 'mullapervez@gmail.com')
>            {
>            print "email_id is in use \n";
>            }
>        
> 
> 
> my $tempuser2 = new user();
> $tempuser2->readbyusername('Tim_sir');
>        if ($tempuser2->{username} eq 'Mulla') 
>        {
>            print "username is already present\n";
>        }
> else {
> print "we have no match\n";
> }
> 
>    my $tempuser4 = new user('pervez', '', 'mulla', 'mullapervez@gmail.com', '193274198');
>    my $string = $tempuser4->{firstname};
>        my @c = split(//, $string);
>        my $userhash = "00$c[0]$c[-1]";
>        print "$userhash \n";
>    #$tempuser4->{userhash} = $userhash;
>    $tempuser4->setuserhash( "$userhash" );
>    $tempuser4->write;
>    
>     
> when I submit data , that data must come in place "my $tempuser4 = new user('pervez', '', 'mulla', 'mullapervez@gmail.com', '193274198');" ...
> 
> how can I do this ...>>?
> 
> Look forward for hear from you soon
> 
> Thank You
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Call perl to store data in DB Mulla <mullapervez@gmail.com> - 2012-08-31 01:40 -0700
  Re: Call perl to store data in DB Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-08-31 10:11 +0100
  Re: Call perl to store data in DB "Octavian Rasnita" <orasnita@gmail.com> - 2012-08-31 12:19 +0300
    Re: Call perl to store data in DB Mulla <mullapervez@gmail.com> - 2012-08-31 02:31 -0700
    Re: Call perl to store data in DB Mulla <mullapervez@gmail.com> - 2012-08-31 02:31 -0700

csiph-web