20101205

GAE forms

To validate a form one could validate with javascript clientside. I too want form validation, preview, blobstore, i18n and edit items preferably with no thirdparty libraries so trying to learn how with a Form class with BlobStore blobs I got this in the upload handler ie a BlobstoreUploadHandler that uploads a blobstore blob using a form class ...
blob_info = self.get_uploads()[0] 
data = AForm(data=self.request.POST) 
entity = data.save(commit=False) 
entity.put() 
im = Image(reference=entity) 
im.primary_image = blob_info.key() 
im.put() entity.put()
... Dispatching to upload handling is a view class that renders self.render_template("upload.html", { 'form': form, 'form_url': blobstore.create_upload_url('/fileupload'),
Then I enabled the form page to also able to edit an item
if self.request.get('id'): 
a = A.get_by_id(long(self.request.get('id'))) 
form = AForm(instance = a) 
else: form = AForm() 
After that I too have issues with validation and preview where BlobStore seems doable to fit in a form.
My form class is
class AForm(djangoforms.ModelForm): 
text = forms.CharField(widget=forms.Textarea(attrs={'rows':'11','cols':'70','class':'foo'}),label=_("content").capitalize()) 
class Meta: 
model = A 
fields = ['category','currency','price','title','phonenumber','postaladress','name','text','email'] #change the order
I now hope we can recommend or comment how to enable validation and preview the "official" way. Since django.contrib.formtools.preview appears built in GAE it could be good to first try what the SDK provides to minimize thirdparty library dependency. I didn't look at formish yet and will do so onwards.

4 comments:

Anonymous said...

INSERT

Anonymous said...

I've as a last resort liked things like sand clocks, lava lamps, and the like to well-wishing of just fritter away space staring at it as a configuration of catharsis. In a route, it helps me with meditation, to reduce lay stress and decent think fro nothing. That's why since I was a kid, a substitute alternatively of dolls and cars I've eternally collected more of such pieces like sand clocks, lava lamps, tuneful boxes etc. So I was most charmed when I start the[url=http://www.dealtoworld.com/goods-1260-2-Laser++LED+Light+Show+Laser+Top+Gyroscope+with+Music+Effects.html] 2-Laser + LED Shine Presentation Laser Crown Gyroscope with Music Effects[/url] from DealtoWorld.com under the aegis the Toys section. It's like a musical caddy, a spinning head, and a radiance reveal all rolled into one. Which is spectacular entertainment! The gyroscope pleasure whirl after round a minute. The laser explanation show with accompanying music makes this gyroscope a measure corresponding exactly tiny that my friends be suffering with also been most amused with.

My dogs are also pretty eccentric prevalent the laser gyroscope I got from DealtoWorld.com. They unceasingly occupy oneself with the gyroscope as it spins, although at earliest they kept barking at the laser slight show, and also because it produces music. But after they got worn it, they've stopped barking but virtuous save up following the gyroscope whenever I start spinning it. Kids are also bonny amused next to it. Sometimes it's good to possess pleasing toys around the blood so that you can desert the small on while the kids are being amused or playing with it while you go prepare scoff or sock changed. The gyroscope is inseparable such fool with with this purpose.

The gyroscope I bought from DealtoWorld.com has a dragon as a design on it, and produces a gegenschein exposition with red, blue, and green colours. Pit oneself against a look at the pictures I've uploaded of the gyroscope with laser joyful show. The music produced from the gyroscope is not that renowned but decorous plenty to accommodate any new guest to the house. The gyroscope is red and raven, making it look extraordinarily cool, and to some virile with that dragon imprint.

The music dismount attack plain gyroscope runs on 6 LR44 batteries, which are replaceable anyway. I've also used this gyroscope to their heels my girlfriend during our anniversary celebration. I did the cheesy chore of decorating the hotel latitude with roses and when I led her in, I started up the gyroscope as rise so that the laser torchlight clarify produces a dreamed-up effect. I also had some battery operated candles so all the light effects created a sort of mawkish atmosphere. She loved it, by the going, to my relief. I also bought the candles from DealtoWorld.com. These days it seems to be my oversight shopping site for all gifts and ideas in support of romanticist occasions.

Since Christmas is coming, this laser lamp playing gyroscope can maybe be a superb Christmas favour seeking the toddler or in spite of the humour! Alternatively, the gyroscope can altogether be a gracious reckoning to the established Christmas decorations. I can take it as given placing it adjoining the Christmas tree and perchance spinning it when guests arrive in the house. Looks like [url=http://www.dealtoworld.com]DealtoWorld.com[/url] is getting my business still again!

Anonymous said...

Hi,

Thanks for sharing the link - but unfortunately it seems to be down? Does anybody here at niklasro.blogspot.com have a mirror or another source?


Cheers,
Charlie

Anonymous said...

Hey,

This is a question for the webmaster/admin here at niklasro.blogspot.com.

May I use part of the information from this blog post right above if I provide a link back to this website?

Thanks,
Alex

www.koolbusiness.com 16

Subscribe Now: Feed Icon

Contributors