Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6062 closed (wontfix)

integrity error Date field auto_now_add for RelatedKey field object data (edit_inline)

Reported by: alex@… Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords:
Cc: vic@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hello,
I also stepped to problem similar to ticket:3156 (but this bug is another branch, also problem only looks similar, but patch is different)

I have Order, and related model GoogleOrderInformation which I want to see/edit inline.
Here is related part of model code:

class GoogleOrderInformation(models.Model):
    order = models.ForeignKey(Order,edit_inline=models.STACKED,max_num_in_admin=1)
    google_order_number = models.CharField(maxlength=40)
....
    added = models.DateTimeField(auto_now_add = True)
    changed = models.DateTimeField(auto_now = True)
...

When I hit "save" button in Django oldforms admin, I get this error:

Exception Type:  	IntegrityError
Exception Value: 	null value in column "added" violates not-null constraint

And the actual SQL code at the bottom shows me this:

'UPDATE "GoogleCheckout_googleorderinformation" SET "order_id"=\'8314\',"google_order_number"=\'das\',"added"=NULL,"changed"=\'2007-11-30 16:29:26.995612\',"eligible_for_protection"=true,"avs_response"=\'f\',"cvn_response"=\'f\',"partial_cc_number"=\'sfsd\',"buyer_account_age"=NULL,"timestamp"=\'2007-11-30 18:18:09\' WHERE "id"=\'2\''

I've looked at actual manipulators code (btw not easy to read/understand) and patched it quickly.

I would like to share this patch with Django community, so anyone else encountering same problem will be able to patch it.

Attached is patch, as it works for me. No guarantees that it works for you.

I did not made tests, neither I tested it for MySQL or SQLlite. That is because I've been told a number of times that all patches to oldforms admin
are not useful, and will be refused anyway, so I don't want to spend much of my time on this. Just use patch if it fixes your problem, and lets
hope all for a quicker release of newforms-admin.

Attachments (1)

patch.txt (1.1 KB) - added by alex@… 7 years ago.
Patch, as I see it. No guarantees

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by alex@…

Patch, as I see it. No guarantees

comment:1 Changed 7 years ago by MichaelBishop

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

NFA is coming soon, so this won't be fixed.

comment:2 Changed 7 years ago by anonymous

Yes, very good that NFA is coming soon. But "soon" is pretty elastic term. During last ~8months I've been told that newforms-admin coming soon, and some bugs were closed as "wontfix" at that time. Does it makes less actual bugs? No. That makes illusion that there are less bugs, because they are not listed in Trac.

IMO: Until NFA is finished and merged into trunk, typical users can not use newforms-admin, so they would use old admin, without even knowing
that it contains a lot of 'wontfix' bugs. I've already raised one discussion on the point of closing bugs in django-developers. And all people confirmed - until bug is fixed or the broken part of software is replaced, bug must stay open for a convince of people which can look at open bugs, take the patch and apply it.

I think its self-deception to close actual bugs. People would look at trac, and see no bugs. They don't know that we "mean to replace part of software any time soon, until that, please don't even report actual bugs against current trunk". Such behavior looks strange to me.

Does it sounds correct or I am wrong with my assumptions?

For people like me, who are actually *using* current admin, please look at collection of patches against it:
http://djwarehouse.org/browser/djWarehouse/trunk/docs/patches
which makes at least possible to use current admin until great future became reality.

comment:3 Changed 7 years ago by anonymous

  • Cc vic@… added
Note: See TracTickets for help on using tickets.
Back to Top