Default value in Column definition doesn't work when function
Open
@lw is already working on this.
Since Feb 28, 2018.
- Dominant language
- Python
- Stars
- 1k
- Forks
- 412
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 3
Description
For example, in User.password:
s = Session()
s.add(User(username="k", first_name="'", last_name="p"))
s.commit()
ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'function' [SQL: 'INSERT INTO users (first_name, last_name, username, password, email, timezone, preferred_languages) VALUES (%(first_name)s, %(last_name)s, %(username)s, %(password)s, %(email)s, %(timezone)s, %(preferred_languages)s) RETURNING users.id'] [parameters: {'first_name': "'", 'last_name': 'p', 'username': 'k', 'password': <function User. at 0x7f7812a0d378>, 'email': None, 'timezone': None, 'preferred_languages': []}]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.