This is your database error..
On Dec 28, 8:32 am, Timboy <corn13r...@gmail.com> wrote:
> Great link. I was really excited to try it.
>
> Here is my new inline:
> class rentalInline(admin.TabularInline):
> model= Rent
> extra = 3
> raw_id_fields = ('movie',)
> exclude = ['rented_by']
>
> def save_formset(self, request, form, formset, change):
> instances = formset.save(commit=False)
> for instance in instances:
> instance.rented_by = request.user
> instance.save()
> formset.save()
>
> I am still getting the same issue:
> Traceback:
> File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py"
> in get_response
> 86. response = callback(request, *callback_args,
> **callback_kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py"
> in root
> 157. return self.model_page(request, *url.split('/',
> 2))
> File "/usr/lib/python2.5/site-packages/django/views/decorators/
> cache.py" in _wrapped_view_func
> 44. response = view_func(request, *args, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/sites.py"
> in model_page
> 176. return admin_obj(request, rest_of_url)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/
> options.py" in __call__
> 197. return self.change_view(request, unquote(url))
> File "/usr/lib/python2.5/site-packages/django/db/transaction.py" in
> _commit_on_success
> 238. res = func(*args, **kw)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/
> options.py" in change_view
> 583. self.save_formset(request, form, formset,
> change=True)
> File "/usr/lib/python2.5/site-packages/django/contrib/admin/
> options.py" in save_formset
> 382. formset.save()
> File "/usr/lib/python2.5/site-packages/django/forms/models.py" in save
> 372. return self.save_existing_objects(commit) +
> self.save_new_objects(commit)
> File "/usr/lib/python2.5/site-packages/django/forms/models.py" in
> save_new_objects
> 407. self.new_objects.append(self.save_new(form,
> commit=commit))
> File "/usr/lib/python2.5/site-packages/django/forms/models.py" in
> save_new
> 473. return save_instance(form, new_obj, exclude=
> [self._pk_field.name], commit=commit)
> File "/usr/lib/python2.5/site-packages/django/forms/models.py" in
> save_instance
> 59. instance.save()
> File "/home/richard/work/svn/moviedb/../moviedb/store/models.py" in
> save
> 91. super(Rent, self).save(**kwargs)
> File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in
> save
> 307. self.save_base(force_insert=force_insert,
> force_update=force_update)
> File "/usr/lib/python2.5/site-packages/django/db/models/base.py" in
> save_base
> 379. result = manager._insert(values,
> return_id=update_pk)
> File "/usr/lib/python2.5/site-packages/django/db/models/manager.py" in
> _insert
> 138. return insert_query(self.model, values, **kwargs)
> File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in
> insert_query
> 888. return query.execute_sql(return_id)
> File "/usr/lib/python2.5/site-packages/django/db/models/sql/
> subqueries.py" in execute_sql
> 308. cursor = super(InsertQuery, self).execute_sql(None)
> File "/usr/lib/python2.5/site-packages/django/db/models/sql/query.py"
> in execute_sql
> 1700. cursor.execute(sql, params)
> File "/usr/lib/python2.5/site-packages/django/db/backends/util.py" in
> execute
> 19. return self.cursor.execute(sql, params)
>
> Exception Type: IntegrityError at /admin/store/renter/4/
> Exception Value: null value in column "rented_by_id" violates not-null
> constraint
--~--~---------~--~----~------------~-------~--~----~
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
django-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---