Comments (3)
Agreed.
On Tuesday, June 17, 2014, Ben Welsh [email protected] wrote:
It would be nice if we didn't have to do all this
http://django-bakery.readthedocs.org/en/latest/buildablemodels.html#celery-task-queue-integration
every time we implement a Celery based deployment.—
Reply to this email directly or view it on GitHub
#52.
-Ken Schwencke
from django-bakery.
Tell me what's wrong below.
- Even if we abstract away the save override stuff we typically use, a user will need to specify the
is_published
boolean field that our system will use to test if an object has been published or unpublished. - My gut feeling is that you should have to opt in to the celery task system and it should not be on by default. That would mean we do not package celery with the setup.py and it would have to be installed with pip independently.
- As for how you opt-in at the model level, I'm not sure but I think we have a couple options. There could be an optional boolean attribute you stick on the BuildableModel class we have now that would hook everything up. Or we could make child class on BuildableModel called
AutomaticallyBuildableModel
orBuildableModelWithTasks
or something like that would have the extra attributes and tricks appended. Simply have your custom models inherit from that, specify youris_published
field (and maybe we could haveis_published
as a sensible default) and it would hook in with the tasks right away. - We should make a new
advanced usage
section of the documentation that explains how to do this, once we've worked it out, as well as the JSON view stuff we ironed out recently - We should be able to come up with unit tests for the tasks by building some fake objects and verifying they exist (or don't) afterward.
from django-bakery.
I suppose the new model needs a delete()
override as well? Something like:
def delete(self, *args, **kwargs):
# if obj.save(unpublish=False) has been passed, we skip the task.
unpublish = kwargs.pop('unpublish', True)
super(self.__class__, self).delete(*args, **kwargs)
if not unpublish:
pass
else:
tasks.unpublish.delay(self)
from django-bakery.
Related Issues (20)
- Relative path to the build directory is treated like absolute HOT 5
- BuildableModel doesn't work HOT 1
- Allow rendering function views HOT 1
- Bakery doesn't run `MIDDLEWARE_CLASSES`/`MIDDLEWARES` on build HOT 3
- InvalidCharsInPath error for BUILD_DIR while attempting to build project HOT 15
- Build fails when I add messages HOT 2
- Incremental builds through change detection? HOT 1
- Excluding model media from build HOT 1
- Gzip corrupts buildserver response
- Working with Digital Ocean Spaces
- Need some way to figure out if the page is being generated statically HOT 4
- Integration with django-storages (AWS S3)
- page parameters
- Scaling memory consumption?
- Fix build command on Windows HOT 6
- Add Django 4.0 support
- Broken link HOT 1
- BUILD_DIR fails if it you give it a `pathlib.Path`
- Add an option to run AutoPublishingBuildableModel tasks without celery
- Integrate publish command with django-storages
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 django-bakery.