Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1: AttributeError: Manager isn’t accessible via <<models>> instances #112

Open
Dcolonel6 opened this issue Jun 19, 2022 · 0 comments

Comments

@Dcolonel6
Copy link

change published to something like pulished_post or objects_published because published attribute is conflicting with one the status choices.

class Post(models.Model):
objects = models.Manager()
published = PublishedManager()
drafted = DraftedManager()
STATUS_CHOICES = (
('draft', 'Draft'),
('published', 'Published'),
)
title = models.CharField(max_length=250)
slug = models.CharField(max_length=250, unique_for_date='publish')
body = models.TextField()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant