AttributeError: 'str' object has no attribute 'unwrap'
See original GitHub issueI’m trying to retrieve rows from the database and get this error. My table looks as follows:
class Post(Model):
date = DateField()
user = ForeignKeyField(User, backref='numbers')
number1 = DecimalField(6,2)
number2 = DecimalField(6,2)
class Meta:
database = SqliteDatabase('data.db')
primary_key = CompositeKey('date', 'user')
What can be the problem?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
AttributeError 'str' object has no attribute - Stack Overflow
I am new to python and I get stuck in this error. I want to print names and years of birth of animals...
Read more >AttributeError: 'str' object has no attribute 'Id' - Developers
So i feed the current view (as done so by the guys in the above mentioned link), which in the Python script is...
Read more >AttributeError: 'str' object has no attribute 'send' : r/learnpython
Im trying to get text from a entry in tkinter and send it to the server but it keeps doing this. AttributeError: 'str'...
Read more >inspect — Inspect live objects — Python 3.11.1 documentation
For example, signature() uses this to stop unwrapping if any object in the chain has a __signature__ attribute defined. ValueError is raised if...
Read more >attribute error peewee (Example) | Treehouse Community
_meta.db_table) AttributeError: 'str' object has no attribute '_meta'. import datetime from peewee import * db = SqliteDatabase('diary.db') ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You need to read the docs. It’s nowhere indicated that you pass string field-names into the select() method. You use the field instances themselves.
Also selecting Post.user will just grab the user_id.