Comments (3)
So we can show polls in blog posts (here for instance).
I registered machina TopicPoll
as a wagtail snippet added a SnippetChooserBlock
to our streamfield here and adapted machina template a bit in here.
I also had to create a template tag to fetch poll form here
Sadly machina polls views will redirect to the forum post. So after voting or asking to change vote, user will come to forum post and not the blog post.
One would have to subclass TopicPollVoteView to override get_success_url
.
Changing vote should be handled too as machina just add a get param ?change_vote=true
.
Anyway it's a step forward.
from openstudyroom.
So this has created some issue.
For some reasons the above change will refer to TopicPoll
as machina.core.db.models.TopicPoll
in migration file.
Running migrate
will hence raise AttributeError: module 'machina.core.db.models' has no attribute 'TopicPoll'
.
I tried changing the import in home.models
to from machina.apps.forum_conversation.forum_polls.models import TopicPoll
but still migration files will refer to machina.core.db.models.TopicPoll
.
Then I tried importing abstract models as follow:
from machina.apps.forum_conversation.forum_polls.abstract_models import AbstractTopicPoll as TopicPoll
This does makes migrations files consistent since they refer to machina.apps.forum_conversation.forum_polls.abstract_models.AbstractTopicPoll
but we then have error at runtime type object 'AbstractTopicPoll' has no attribute 'objects
.
from openstudyroom.
This was fixed adding TopicPoll.__module__ = "machina.apps.forum_conversation.forum_polls.models"
to home.models
from openstudyroom.
Related Issues (20)
- Bug - Sgf viewer context menu appears below viewer board HOT 4
- confusion with both senses of primary leagues HOT 2
- League/archives/ allow table sorting HOT 6
- update ogs.py PR #425 HOT 1
- dark css theme HOT 1
- Ben Mantle teacher info page not served HOT 1
- Users can add javascript code inside forum post
- Group Markdown - Edit Button HOT 1
- Populating a league can raise an error HOT 4
- UnboundLocalError at /league/:id HOT 1
- anonymous users should not be able to add available events HOT 4
- Homepage picture url is down
- Layout on mobile hides join/quit buttons
- Non square boards would break scraper
- Create SDK League Slug HOT 2
- [Request] Incorporate a kanban board for the admin team? HOT 2
- Question/answers library
- Weird unicode characters prevent event tag to be recognized
- fixtures have been broken HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openstudyroom.