Skip to content

AttributeError: 'bool' object has no attribute 'last' #17

@MayurUp

Description

@MayurUp

Hi, I am having trouble when I want to make a second post.

File "/posts/models.py", line 37, in upload_location
new_id = 1
qs = PostModel.objects.order_by("id").exists()
if qs:
new_id = qs.last().id + 1
AttributeError: 'bool' object has no attribute 'last'

Can anyone help me with this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions