Isaac Csandl wrote:

> I updated to the latest SA (0.4.2p3) & Elixir 0.5.0 (making the
> appropriate changes for the new defaults) but now the update
> methods of controllers won't save any changes.
>
> [snip, snip...]
>
> I've tried every combination of flush(), save_or_update(),
> commit() I could think of, even tried a few absurd ones just for
> fun. Even created a new, empty project and followed Jonathan's
> instructions on Pylons + Elixir to the letter to be sure there
> wasn't something lurking in my older project.

All I know is that its working fine for me.  I just tested it with
a fresh project configured exactly like in the tutorial on my blog,
and placed the existing action into my a controller:

     def update(self):
         names = ['A', 'B', 'C']
         person = model.Person.get(1)
         person.name = random.choice(names)
         model.Session.commit()
         c.people = Person.query.all()
         return render('people')

... and everything worked just fine.  Note, that if you are using
my recipe, you shouldn't need to flush any object, just create it,
or make changes to it, and when you commit your session, it'll get
flushed automatically.

Try getting rid of all the extraneous stuff, like the validate, and
make a test case that does something ridiculously simple, like this:

     def update(self):
         person = Person.get(1)
         person.name = 'TESTING 123'
         Session.commit()
         redirect_to(
             url_for(controller='person', action='index', id=None)
         )

... and see if it works for you.  Good luck Isaac, I'm sure you'll
figure it out!

--
Jonathan LaCour
http://cleverdevil.org


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

Reply via email to