Closed LunarTwilight closed 1 year ago
Can you share the schema and an example row from the table that has the issue?
Looks like possibly peewee can't find the row you're trying to edit or delete, possibly because the serialization of the primary key has a problem somewhere.
I've added a patch which fixes the TypeError -- this looks to be a situation where the serialization of your composite primary key has some kind of issue. Possibly the values that make up the key are very long?
If you can provide a minimal schema and an example failing row data so I can try to replicate, I'll be happy to reopen and provide a fix.
Updated to 0.5.2 and it's looking like it's due to the row containing NULL, as other rows that don't have a NULL value are fine.
The table's schema is
CREATE TABLE "filters" (
"regex" TEXT,
"action" TEXT,
"duration" TEXT,
"shouldDelete" INTEGER
)
and for an example row, regex
can be "example", action
can be "alert", duration
is NULL, and shouldDelete
is 0.
Does that table have a primary key? And if so are you using nullable values as part of the primary key? I think that might be the issue and I'd suggest that you probably ought to use an integer I'd or something along those lines...
Does that table have a primary key? And if so are you using nullable values as part of the primary key? I think that might be the issue and I'd suggest that you probably ought to use an integer I'd or something along those lines...
The table doesn't have a primary key
Ok then that's your issue.
yep setting a primary key for the table fixed it, thanks
If there is no primary key I was thinking that it wouldn't show any option to edit or delete, was that not the case? In other words I'm surprised you got an error, because I intended to check for the presence of a pk in order to allow those operations.
If there is no primary key I was thinking that it wouldn't show any option to edit or delete, was that not the case? In other words I'm surprised you got an error, because I intended to check for the presence of a pk in order to allow those operations.
There was an option to edit/delete for every row
When I try to delete or edit a row I get this error
but there's also exceptions that happen when handling that exception apparently, and also the website shows a different error (along with exceptions that happened when handling that exception), so I'm not exactly sure what the issue is
The errors only happen with some rows (seems like it might be due to it having a space or something?), trying to edit or delete other rows either shows the UI as expected, or returns a 404.