Re: populating database model with form model

2008-11-16 Thread jtobe

yes, i wanted all the new features and enhancements from 1.0 over
0.96, so i package my own django 1.0 version in the project.

i have tried to use google's djangoforms as well as django.form and
using either one, i get the same errors.

i do appreciate all you trying to help me with this. i just wish i
knew enough to figure it out without bothering you guys.



On Nov 16, 5:47 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> Beware, though, of assuming exact parallels. The django on GAE is a)
> somewhat out of date, and b) modified to adapt it to the Google App
> Engine hosting environment.
>
> Good luck with your project.
>
> regards
>  Steve
>
>
>
> jtobe wrote:
> > thanks for trying to help.
>
> > app engine models use .put() instead of .save() and according to
> > guido, there is very little difference between the two.
>
> > I have pasted models.py and search.py so you can see the two. maybe
> > that will help.
>
> > paste url:http://dpaste.com/91258/
>
> > the django app i'm bulding here is suppose to be an "orbitz
> > equivalent" for my software engineering class. we chose to use django
> > and app engine for the free hosting and a chance to use something we
> > had only read about (django).
>
> [...]
> --
> Steve Holden        +1 571 484 6266   +1 800 494 3119
> Holden Web LLC              http://www.holdenweb.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: populating database model with form model

2008-11-16 Thread jtobe

thanks for trying to help.

app engine models use .put() instead of .save() and according to
guido, there is very little difference between the two.

I have pasted models.py and search.py so you can see the two. maybe
that will help.

paste url: http://dpaste.com/91258/

the django app i'm bulding here is suppose to be an "orbitz
equivalent" for my software engineering class. we chose to use django
and app engine for the free hosting and a chance to use something we
had only read about (django).

On Nov 16, 3:18 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Nov 16, 6:43 pm, jtobe <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, i wasn't sure whether i should ask this here or on the google app
> > engine list.
>
> > I really have two problems. The first is, if i have a form that i
> > populate choices in a choicefield using entries in the database, it
> > only updates once. Every time after the first time it just uses the
> > same vales it found before, even if i go add more items to the
> > dateabase. I have tried deleting all browser cache.
>
> > I have a datastore model (reason for being unsure) that i am trying to
> > load with information submitted through a django model form. For a
> > long time, when i would submit the form i would get an error
> > initialize the datastore model using named arguments in the
> > constructor. it would say:
> > 'unicode' object has no attribute 'is_saved'
>
> > I would send these values using:
> > form = SearchForm(request.POST)
> > MyModel(
> >     field_name = form.cleaned_data.get('field_name', 'default'),
> >     bool_field_name = form.cleaned_data.get('bool_field_name', False)
> > )
>
> > I would get this error even if i tried to pass values directly, like:
> > MyModel(field_name="value", bool_field_name=True)
>
> > Lately, though, the page has just been always failing when checking
> > is_valid() on the form. (always returns False)
>
> > I am a fairly novice django user, and a fairly novice app engine user.
> > I have read the djangobook many times, and i have googled this problem
> > to death. If anyone has any suggestions or advice or anything that
> > might help me, please reply. I would greatly appreciate it.
>
> I don't know anything about Google App Engine, except that it manages
> models differently from normal Django. All I can say is that in
> standard Django, your two MyModel calls above do exactly the same
> thing: create a new model instance with the values you pass, then
> immediately throw it away. It won't be saved to the database, because
> you're not telling it to be.
>
> You would need to do something like:
> new_obj = MyModel(field_name='value')
> new_obj.save()
>
> For your other problems, you'll need to give more details. Preferably,
> post your code on dpaste.com and post a link here.
> --
> DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



populating database model with form model

2008-11-16 Thread jtobe

Hi, i wasn't sure whether i should ask this here or on the google app
engine list.

I really have two problems. The first is, if i have a form that i
populate choices in a choicefield using entries in the database, it
only updates once. Every time after the first time it just uses the
same vales it found before, even if i go add more items to the
dateabase. I have tried deleting all browser cache.

I have a datastore model (reason for being unsure) that i am trying to
load with information submitted through a django model form. For a
long time, when i would submit the form i would get an error
initialize the datastore model using named arguments in the
constructor. it would say:
'unicode' object has no attribute 'is_saved'

I would send these values using:
form = SearchForm(request.POST)
MyModel(
field_name = form.cleaned_data.get('field_name', 'default'),
bool_field_name = form.cleaned_data.get('bool_field_name', False)
)

I would get this error even if i tried to pass values directly, like:
MyModel(field_name="value", bool_field_name=True)

Lately, though, the page has just been always failing when checking
is_valid() on the form. (always returns False)

I am a fairly novice django user, and a fairly novice app engine user.
I have read the djangobook many times, and i have googled this problem
to death. If anyone has any suggestions or advice or anything that
might help me, please reply. I would greatly appreciate it.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---