form processing question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • WmGill

    form processing question

    I am experimenting with Python, and want to convert some of my PHP scripts
    to python cgi scripts. In PHP I use PHP_SELF for the action target. This
    way I can "reuse" data in fields (i.e. if the user enters data in a field
    then submits the form, it comes back already filled in on each subsequent
    iteration). I know I can do this in Python, but before I spend a lot of
    time, is it very complicated, or can form field values be (re-)populated
    easily?

    Thanks

    Bill


  • John J. Lee

    #2
    Re: form processing question

    "WmGill" <wmgill@wmgill. com> writes:
    [color=blue]
    > I am experimenting with Python, and want to convert some of my PHP scripts
    > to python cgi scripts. In PHP I use PHP_SELF for the action target. This[/color]
    [...question snipped...]

    Which web framework / library are you using?

    Or are you just using the standard library cgi module (most Python web
    programmers use something more than that)?


    John

    Comment

    • WmGill

      #3
      Re: form processing question

      Like I said, I'm experimenting. I was thinking of using the standard cgi
      module. but I'm open to suggestions.

      Bill

      "John J. Lee" <jjl@pobox.co m> wrote in message
      news:87ism2754c .fsf@pobox.com. ..[color=blue]
      > "WmGill" <wmgill@wmgill. com> writes:
      >[color=green]
      > > I am experimenting with Python, and want to convert some of my PHP[/color][/color]
      scripts[color=blue][color=green]
      > > to python cgi scripts. In PHP I use PHP_SELF for the action target.[/color][/color]
      This[color=blue]
      > [...question snipped...]
      >
      > Which web framework / library are you using?
      >
      > Or are you just using the standard library cgi module (most Python web
      > programmers use something more than that)?
      >
      >
      > John[/color]


      Comment

      • JZ

        #4
        Re: form processing question

        On Sun, 2 Nov 2003 18:19:06 -0500, "WmGill" <wmgill@wmgill. com> wrote:
        [color=blue]
        >Like I said, I'm experimenting. I was thinking of using the standard cgi
        >module. but I'm open to suggestions.[/color]

        Look at Spyce framework: http://spyce.sourceforge.net
        It is similiar to PHP but uses Python syntax.

        --
        JZ ICQ:6712522

        Comment

        • Ian Bicking

          #5
          Re: form processing question

          On Nov 2, 2003, at 4:41 PM, WmGill wrote:[color=blue]
          > I am experimenting with Python, and want to convert some of my PHP
          > scripts
          > to python cgi scripts. In PHP I use PHP_SELF for the action target.
          > This
          > way I can "reuse" data in fields (i.e. if the user enters data in a
          > field
          > then submits the form, it comes back already filled in on each
          > subsequent
          > iteration). I know I can do this in Python, but before I spend a lot
          > of
          > time, is it very complicated, or can form field values be
          > (re-)populated
          > easily?[/color]

          You probably will be happier if you use something other than CGI, but
          for CGI I believe os.environ()['SCRIPT_NAME'] should give you what you
          want. (This URL introspection differs considerably between frameworks)

          --
          Ian Bicking | ianb@colorstudy .com | http://blog.ianbicking.org


          Comment

          • WmGill

            #6
            Re: form processing question

            > You probably will be happier if you use something other than CGI,...
            I thought the cgi interface was the standard for HTML form processing?
            [color=blue]
            > I believe os.environ()['SCRIPT_NAME'] should give you what you want...[/color]
            I don't see where knowing the script name helps?

            Others have also suggested using other programs. I obviously need to be
            more clear in what I thought was a simple question.

            Lets say I have a simple html form that asks for: First Name, Last Name,
            department, Employee ID, and comments. An emplyee fills out the form,and
            clicks submit. My script looks up the employee ID and doesn't find him/her,
            so it returns (displays) the form for correction, but leaving all the
            submitted information in the original input fields so that the employee
            doesn't have to re-enter everything. I know how to do this in PHP, but want
            to try it in Python.

            Bill



            "Ian Bicking" <ianb@colorstud y.com> wrote in message
            news:mailman.35 2.1067818417.70 2.python-list@python.org ...[color=blue]
            > On Nov 2, 2003, at 4:41 PM, WmGill wrote:[color=green]
            > > I am experimenting with Python, and want to convert some of my PHP
            > > scripts
            > > to python cgi scripts. In PHP I use PHP_SELF for the action target.
            > > This
            > > way I can "reuse" data in fields (i.e. if the user enters data in a
            > > field
            > > then submits the form, it comes back already filled in on each
            > > subsequent
            > > iteration). I know I can do this in Python, but before I spend a lot
            > > of
            > > time, is it very complicated, or can form field values be
            > > (re-)populated
            > > easily?[/color]
            >
            > You probably will be happier if you use something other than CGI, but
            > for CGI I believe os.environ()['SCRIPT_NAME'] should give you what you
            > want. (This URL introspection differs considerably between frameworks)
            >
            > --
            > Ian Bicking | ianb@colorstudy .com | http://blog.ianbicking.org
            >
            >[/color]


            Comment

            Working...