mirror of
https://github.com/jeffknupp/sandman2.git
synced 2026-04-25 00:25:49 +03:00
[GH-ISSUE #34] 500 Inernal Server Error while inserting into a table via admin interface #21
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
pull-request
question
refactoring
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/sandman2-jeffknupp#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pavdmyt on GitHub (Apr 5, 2016).
Original GitHub issue: https://github.com/jeffknupp/sandman2/issues/34
Hi,
I'm using sandman2 with PostgreSQL.
Every time inserting data into a table using admin interface I'm receiving this page:
However, table becomes updated and selects in
psqlshows new inserted data.@jeffknupp commented on GitHub (Jul 22, 2016):
I'm not able to reproduce this. Can you give some more info?
@Datamance commented on GitHub (Aug 3, 2016):
I'm getting something somewhat similar with sandman2ctl:
@jeffknupp commented on GitHub (Aug 3, 2016):
Please try downloading version
0.1.0from pypi and let me know if you see the same issue@Datamance commented on GitHub (Aug 6, 2016):
@jeffknupp I can actually edit records through the admin interface now, but I still get this error when I try to insert a brand new record:
"sqlalchemy.exc.CompileError: Column 'proposals.id' is marked as a member of the primary key for table 'proposals', but has no Python-side or server-side default generator indicated, nor does it indicate 'autoincrement=True' or 'nullable=True', and no explicit value is passed. Primary key columns typically may not store NULL."
I actually created these tables with my own SQLAlchemy ORM classes using the following mixin:
^^^^ you can see above that the mixin had a default python generator. Probably why I never got this error with SQLAlchemy-jsonapi or flask-restless.
Once again, I'm guessing I'll have to extend sandman2.model.Model to make this work. Let me know if you think of any other solutions.
@jeffknupp commented on GitHub (Sep 6, 2016):
So the newest version of
sandman2uses a version of SQLAlchemy still in beta (1.0.0b4 I think) that supports "scalar defaults" in the manner you want. Here's the documentation: http://docs.sqlalchemy.org/en/latest/changelog/migration_11.html#new-init-scalar-event-intercepts-default-values-at-orm-level@jeffknupp commented on GitHub (Sep 20, 2016):
Closing as can not duplicate