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

BuildableModel doesn't work #129

Open
xOceanFirex opened this issue Oct 1, 2018 · 1 comment
Open

BuildableModel doesn't work #129

xOceanFirex opened this issue Oct 1, 2018 · 1 comment
Labels

Comments

@xOceanFirex
Copy link

xOceanFirex commented Oct 1, 2018

Hi,
Could you tell me what is wrong with my code? Unfortunately that what i can find on readthedocs.io doesn't working at all. On this page it is described that i should use Celery but when i use lastet version this isn't mentioned.

blog/models.py

class Album(BuildableModel):
    detail_views = ('blog.views.AlbumDetails', 'blog.views.HomePageBake')
    artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
    name = models.CharField(max_length=100)
    release_date = models.DateField()
    num_stars = models.IntegerField()
    cover_src = models.CharField(max_length=255)
    is_published = models.BooleanField(default=False)

    def __str__(self):
        return self.name

    def get_absolute_url(self):
        return '/blog/album/%s/' % self.id

blog/views.py

class HomePageBake(BuildableListView):
    queryset = Album.objects.all()
    build_path = 'blog/index.html'
    template_name = 'blog/index.html'

    def get_context_data(self, **kwargs):
        return {'object_list': self.queryset}


class AlbumDetails(BuildableDetailView, DetailView):
    model = Album
    build_path = 'blog/album.html'
    template_name = 'blog/album.html'
    context_object_name = 'album'

Thanks for your help and please update your docs.

@xOceanFirex xOceanFirex changed the title BuildableModel don't work BuildableModel doesn't work Oct 1, 2018
@palewire
Copy link
Owner

palewire commented Dec 5, 2018

What bug are you seeing?

@palewire palewire added the bug label Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants