Google App Engine + Validation
I am looking for how to do validation on Google App Engine and I have found only how to do it using Django framework. Ok Django approach is ok but if I have one form and this form have data from few tables what then??? I can not do it like this: class Item(db.Model): name = db.StringProperty() quantity = db.IntegerProperty(default=1) target_price = db.FloatProperty() priority = db.StringProperty(default='Medium',choices=[ 'High', 'Medium', 'Low']) entry_time = db.DateTimeProperty(auto_now_add=True) added_by = db.UserProperty() class ItemForm(djangoforms.ModelForm): class Meta: model = Item exclude = ['added_by'] class MainPage(webapp.RequestHandler): def get(self): self.response.out.write('<html><body>' '<form method="POST" ' 'action="/">' '<table>') # This generates our shopping list form and writes it in the response self.response.out.write(ItemForm()) self.response.out.write('</table>' '<input type="submit">' '</form></body></html>') def post(self): data = ItemForm(data=self.request.POST) if data.is_valid(): # Save the data, and redirect to the view page entity = data.save(commit=False) entity.added_by = users.get_current_user() entity.put() self.redirect('/items.html') else: # Reprint the form self.response.out.write('<html><body>' '<form method="POST" ' 'action="/">' '<table>') self.response.out.write(data) self.response.out.write('</table>' '<input type="submit">' '</form></body></html>') Is any easy way to validate form which contain data from few tables or I have to code it alone?
Looks like you're using webapp; I suggest your look at some other 'light-weight' choices for form validation. Pick one that you like the layout / syntax of. You'll be able to define complex 'nested' relationships if needed. FormEncode Formish Deform
WTForms has a GAE component WTForms WTForms now includes support for AppEngine fields as well as auto-form generation. The form class can be used as it is or serve as a base for extended form classes, which can then mix non-model related fields, subforms with other model forms, among other possibilities.
Is there any way to handle Google Datastore Kind Property names with spaces in Golang?
Google App Engine: Disable favicon.ico
Google Cloud DataStore. How to serve data?
How to access a cloud storage bucket from app engine without getting the 403 FORBIDDEN error?
Google App Engine Custom Domain - Routing in Go
Best approach for caching lists of objects in memcache
com.google.gcloud.datastore vs com.google.appengine.api.datastore
Google App Engine - Issue with creating a bulkloading config
Solr Timeout error even data is instered
Why does BigQuery fail to parse an Avro file that is accepted by avro-tools?
Insufficient Permission with Appengine Flex service account to access Drive folder
Getting Invalid Key message thrown when creating child records
Where do I find the pricing for the different frontend instance types?
Missing index on specific entities in app engine
Get current deployed timestamp in AppEngine/Go
Jersey throwing exception in Google App Engine