On Tue, 2009-04-28 at 22:32 -0700, OvermindDL1 wrote: > On Apr 27, 12:14 am, OvermindDL1 <[email protected]> wrote: > > I was originally using what the quickstart built (Catwalk), but even > > when changed to the AdminController (as per the tg2 site > > documentation) I get the exact same issues. > > > > On any of my databases, if I click on new to create a new one, it > > seems it tried to create an empty row (which of course is going to > > fail rather miserably in the great majority of database schemas). > So, > > for example, if I try to create a new User, I get this nice error as > > soon as I click 'new' (which should not be doing any type of DB > access > > at all): > > IntegrityError: (IntegrityError) is420_model_auth_user.user_name may > > not be NULL u'INSERT INTO is420_model_auth_user (user_name, > password, > > created, first_name, last_name, address, city, state, zipcode, > > home_phone, cell_phone, birth_date) VALUES > > (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' [None, None, '2009-04-27 > > 00:06:11.150000', None, None, None, None, None, None, None, None, > > None] > > > > So, how is this fixed? > > > > And no, some of the tables I am using cannot have null values on > some > > of the columns (I do not control all the models, thus I cannot > change > > those). > > > > And yes, I searched this list, found someone mentioning this as a > > known bug many months ago, but nothing before or since. > > So, thoughts anyone? I tried looking through the AdminController, the > CRUD Controller, the configs, the form builds, I cannot seem to find > where it is creating a new Row upon accessing new. Also, why would it > create a row anyway, what if someone backed out of the new screen, it > would leave an invalid row in the table...
This is a total shot in the dark, but it *could* be an old version of toscawidgets. I don't know the AdminController code at all, so I don't know if it's doing the same thing as my home-brew one was, but there was a period where TW was calling all arguments passed in to widgets at init time, so if you passed in a ref to a model class, you would get spurious object creation. Alberto fixed that, but maybe try upgrading your toscawidgets? Total guess. That said, it sounds like even if isn't happening that way, you could look for places where class refs are getting called by accident. :/ Iain --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" 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/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

