Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3637458
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:09:39+00:00 2026-05-19T01:09:39+00:00

I have a user input form here: http://www.7bks.com/create (Google login required) When you first

  • 0

I have a user input form here:

http://www.7bks.com/create (Google login required)

When you first create a list you are asked to create a public username. Unfortuantely currently there is no constraint to make this unique. I’m working on the code to enforce unique usernames at the moment and would like to know the best way to do it.

Tech details: appengine, python, webapp framework

What I’m planning is something like this:

  • first the /create form posts the data to /inputlist/ (this is the same as currently happens)
  • /inputlist/ queries the datastore for the given username. If it already exists then redirect back to /create
  • display the /create page with all the info previously but with an additional error message of “this username is already taken”

My question is:

  1. Is this the best way of handling server side validation?
  2. What’s the best way of storing the list details while I verify and modify the username?

As I see it I have 3 options to store the list details but I’m not sure which is “best”:

  1. Store the list details in the session cookie (I am using GAEsessions for cookies)
  2. Define a separate POST class for /create and post the list data back from /inputlist/ to the /create page (currently /create only has a GET class)
  3. Store the list in the datastore, even though the username is non-unique.

Thank you very much for your help 🙂

I’m pretty new to python and coding in general so if I’ve missed something obvious my apologies.

Tom

PS – I’m sure I can eventually figure it out but I can’t find any documentation on POSTing data using the webapp appengine framework which I’d need in order to do solution 2 above :s maybe you could point me in the right direction for that too? Thanks!

PPS – It’s a little out of date now but you can see roughly how the /create and /inputlist/ code works at the moment here: 7bks.com Gist

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:09:40+00:00Added an answer on May 19, 2026 at 1:09 am

    I would use Ajax to do an initial validation. For example as soon as the user name input box loses focus I would in the background send a question to the server asking if the user name is free, and clearly signal the result of that to the user.

    Having form validation done through ajax is a real user experience delight for the user if done correctly.

    Of course before any of the data was saved I would definitely redo the validation server side to avoid request spoofing.

    jQuery has a nice form validation plugin if you are interested. http://docs.jquery.com/Plugins/validation.

    In my career, I’ve never gotten around having to validate server side as well as client side though.

    About the storing of the list (before you persist it to the datastore). If you use ajax to validate the user name you could keep the other fields disabled until a valid user name is filled in. Don’t allow the form to be posted with an invalid user name!

    That would perhaps solve your problem for most cases. There is the remote possibility that someone else steals the user name while your first user is still filling in his list of books. If you want to solve that problem I suggest simply displaying the list as you got it from the request from the user. He just sent it to you, you don’t have to save it anywhere else.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login.jsp page which contains a login form. Once logged in the
I have a snippet to create a 'Like' button for our news site: <iframe
I have found this example on StackOverflow: var people = new List<Person> { new
i have a input tag which is non editable, but some times i need
This is beyond both making sense and my control. That being said here is
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
Let say I have the following desire, to simplify the IConvertible's to allow me

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.