-
Notifications
You must be signed in to change notification settings - Fork 889
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
alchemy scaffold updates #2024
alchemy scaffold updates #2024
Conversation
68b5f03
to
adb9377
Compare
I'll take on this todo, and list all the files (see above). That covers it. Most of the changes are easy (changing This does not include the community-contributed documentation, like the Cookbook. I can work on this item when the alchemy scaffold is complete. |
Woah... switch to Jinja 2 templates? |
I would have updated for mako. I don't think getting closer to flask/django is a good thing in the end. I would prefer getting closer to mike's stuff for our defaults if we have to make a choice. Sent from my iPhone
|
I don't mind using jinja2. @pauleveritt uses it in the quick tutorial and I use it in all my projects. Since when is this "closer to flask/django" a good or bad thing? It's a framework-agnostic templating language used in many systems including ansible and salt. I mean if people feel so strongly about it that's fine but I told @ergo he could use what he wanted since he was willing to do the work. |
@blaflamme I was having a hard time to decide on mako/jinja2 since I know and use both for a long time - the reason why I decided on jinja2 was to use something that has a syntax that people are more used to - this lowers the entry barrier a bit which I find a good thing because we want to have more people use pyramid in the end. |
If we’re going to vote for unique, less-popular templating languages, we should go with the one ChrisM prefers, Chameleon. It’s the original template language for Pyramid. But I don’t think you’d like that choice. [wink] At the end of the day, we all have different ideas, but Jinja2 and its syntax (Django) are far more popular. We shouldn’t make templating the place where newbies (the audience for a scaffold) thinks we are “different”. Wrong battle to pick, IMO. —Paul
|
@ergo no need to change, I wondered why. Sent from my iPad
|
@pauleveritt sure, I don't want to bring any battle to the table ;) But I would have naturally coupled the zodb scaffold with chameleon and the sqla scaffold with mako. Sent from my iPad
|
How about giving choice and making template system be a parameter of scaffolds? In the end scaffold should be opinionated in regard to its core functionality (SQLAlchemy in this case) and not peripheral things (template system in this case). |
@piotr-dobrogost This might be problematic from maintenance perspective since we would have to understand and update all the templates simulatenously whenever anything would change. @blaflamme At first my initial idea was to use mako, but because of the reasons @mmerickel and @pauleveritt mentioned it felt like the best option to go for jinja2. |
The suggestion from @piotr-dobrogost would inform newbies that there are several templating languages. It would also mean more development work, including the hardest task of all, naming things, compounded by the backward compatible alias of |
Showing multiple templating systems is great but also overly complex for the purposes of this scaffold and PR. Some future work to create alternate start scaffolds would probably be interesting though. |
http://cookiecutter.readthedocs.org/en/latest/ - probably has all the functionality needed. I've been doing some workshops recently introducing pyramid for people, and after got some feedback - especially when evangelizing to people who only did django before - jinja2 seems like a good choice for newcomers. Advanced users can switch to other template engine in few lines of code in the end. |
I reached the same conclusion a while back. @cguardia is doing a lot of work on this in https://github.com/cguardia/cookiecutter-pyramid —Paul
|
Same for me, I've been using cookiecutter for a while for my own stuff and prefer it over scaffolds. We could eventually have official cookiecutters maintained separately from the pyramid core, like we did with template stuff. |
Questions have come up if we want to add alembic migrations to the scaffold. I'd vote for yes, but I am biased in that I have 4 different projects, and I have implemented migrations 4 different ways, having one way that is standardised would be nice. |
What am I doing wrong in my git workflow? I want the commits in yonder PR #2103 to show up in this here PR #2014. Here's what I did:
Instead of step 2, should I have pushed to Pylons/pyramid/feature/alchemy-scaffold-update? |
…date docs updates for Quick Tour for feature/alchemy-scaffold-update
@stevepiercy You need to click the merge pull request button on #2103 and it will show up here. Just did that. Looking forward to seeing these changes :-) |
…date Add Sphinx markers for literalinclude
…date update references in literalincludes
…e' into feature/alchemy-scaffold-update
…date update wiki2/src/basiclayout/tutorial
…date update distributing.rst (done)
@stevepiercy I'm not worried about issues with deprecation warnings introduced in py35 right now. It's better that the tutorial works on py27 and I'd like to avoid hacks in the code to work on both without warnings since our templates don't allow conditional rendering right now. Short answer - don't worry about it. |
…date add note about deprecation warnings on py3
- update src/*/views/default.py - update src/*/routes.py - write new test - revise docs, double-checking line counts and highlighting
…e' into feature/alchemy-scaffold-update
@mmerickel please review #2385 for the feature to redirect to edit page when user attempts to add page that already exists. |
…date redirect to edit page when user attempts to add page that already exists
|
@ztane Sure, my point was that I don't want the code forked on py2 vs py3. If there is a library available to do the escaping on both without warnings then fine. If you or anyone else wants to make that change then be sure to add markupsafe as a dependency in setup.py next to docutils and the text explaining why. |
Awesome folks. Any further changes such as markupsafe should be made as PRs to master! Thanks for the work everyone put into this since Pycon 2014. |
Wow, merged to master. Mega kudos to @mmerickel and also @stevepiercy for keeping an eye on all the ramifications. |
Thank you @mmerickel and @stevepiercy! |
applause |
This is a WIP to bring the alchemy scaffold in line with best practices.
meta
module or package to avoid any circular references when importing.sqla_demo
generated from scaffold and its associated files inquick_tour/sqla_demo/
. Note that there are some comments inserted in these files for Sphinx rendering. See quick_tour.rst, Databases section.authorization|basiclayout|models|tests|views]/ (5 directories)configure_mappers
when initializing the session.