Ticket #2345 (closed defect: invalid)

Opened 1 year ago

Last modified 10 months ago

AdminController/Catwalk disable entry of primary key fields

Reported by: danielfalk Assigned to:
Priority: normal Milestone:
Component: TurboGears Version: 2.0.1
Severity: normal Keywords: needs feedback, admin, catwalk, primary key, disabled
Cc:

Description

As the title says, the primary key entry is disabled. Even if the primary key column is not automatically populated via autoincrement for example. This leaves one unable to create new records at all using the admin.

Long story short: the system should check to see whether the column is auto-filled, not whether it's the pk column.

Change History

(follow-up: ↓ 2 ) 09/24/09 05:16:12 changed by Chris Arndt

  • keywords changed from admin, catwalk, primary key, disabled to needs feedback, admin, catwalk, primary key, disabled.

Is this about CatWalk in TurboGears 1? If so, the ticket version is set incorrectly.

Can you provide a test case demonstrating the issue?

(in reply to: ↑ 1 ) 09/24/09 08:22:26 changed by danielfalk

Replying to Chris Arndt:

Is this about CatWalk in TurboGears 1? If so, the ticket version is set incorrectly.

No, this is Turbogears 2, and I think the AdminController? is based on Catwalk (or the other way around)

Can you provide a test case demonstrating the issue?

I'll have to make one.

(follow-up: ↓ 4 ) 09/25/09 02:26:14 changed by Chris Arndt

Ok, sorry, didn't read the ticket properly, I guess. If you can provide a test case that would be helpful.

(in reply to: ↑ 3 ) 10/27/09 11:47:38 changed by danielfalk

Replying to Chris Arndt:

Ok, sorry, didn't read the ticket properly, I guess. If you can provide a test case that would be helpful.

OK, here are the basic steps:

1) Make a model using SQLAlchemy with entity "MyEntity?" where all or part of the PK does not autoincrement. 2) Run paster setup-app development.ini and paster serve development.ini 3) Go to http://127.0.0.1:8080/admin/ and login. Click the MyEntity? link, then click the "New" link. It will provide inputs for all the fields defined on MyEntity?. Except the PK(s) will not be editable.

For step #1, here are a couple of ways to make a PK that doesn't autoincrement: - PK where all or part of the PK is also a foreign key - Use a String/Unicode type for the PK column

11/17/09 09:08:25 changed by jorge.vargas

  • status changed from new to closed.
  • resolution set to invalid.

This is an issue with sprox itselfs as it assumes this int autoincrement PK for SQL models. I have opened a bug report there linking to this one which has the correct issue http://bitbucket.org/percious/sprox/issue/26/sprox-should-allow-editable-primary-keys-for-non-int-non-autoincrement

Closing this as invalid as it provides the wrong cause. It's a design limitation rather than a bug, as it is "good practice" to depend on this behavior.