Thank you for answer.

But that is bad approach.
Scaffolding application (db.py, layout.html, web2py_ajax.html) has for me 
lot of useful out of the box features and it improves with future versions 
of web2py too.
And I want use advantage of this new improvements.
For example my application is 2 years old, I convert it to current web2py 
version, and it run (with old layout.html). Well.
But because it is based mostly on the scaffolding application, I want take 
advantage from current version of the scaffolding files too. So I need to 
copy current version of (db.py, layout.html, web2py_ajax.html) into my 
application, make realy MINIMUM necessary patches which I was forced to do 
in these files, and my application should run (with bootstrap3 + ...).

So it is not good for me to change scaffolding files, but (if possible) use 
my added code files only.

So my question was:
Is it possible to link css/js files outside of (db.py, layout.html, 
web2py_ajax.html),
i.e. inside my added model, controller, or in my added view, and is there a 
"standard" way where and how to do it?

I have escpecially problem with css files, because they should be linked in 
the <head> tag.
It would be good, if standard layout.html have a <head>....{{include 
customHeadPart.html}}</head> directive, and I could modify this file, which 
is from framework distribution empty (or not present).
I mean something like "user/custom event(s)" called from the distribution 
version of layout.html.

But it looks like it is necessary for me patch the layout.html...?





Dne pátek 3. dubna 2015 1:58:29 UTC+2 Derek napsal(a):
>
> ok first of all, you work with your application and you should just modify 
> your db.py, layout.html and etc. You should not worry about not having the 
> same thing as in the scaffolding in the latest versions, because as you are 
> aware, web2py is fully backwards compatible. So if your application works 
> today in whatever version you are in, it should work with web2py 2.99 or 
> whatever in the future.
>
> second, they are called scaffolding that allow you to build off it. It's 
> like you are building a car with a toothbrush with detachable bristles in 
> case someone builds a better handle. Can't commit to a handle so the 
> bristles sometimes fall off but it can be called a toothbrush.
>
> Look, just grab hold of that scaffolding and tear it to shreds and use it 
> all up like the little piece of kindling that it is. It's just there to get 
> you off the ground, it's not meant to be a foundation from which to build. 
> You should build that, and the good news is 'web2py is backwards 
> compatible' you aren't going to be left in the cold when a new version of 
> web2py comes out...
>
>
>
> On Wednesday, April 1, 2015 at 11:54:52 PM UTC-7, Mirek Zvolský wrote:
>>
>> Hi,
>>
>> I like the approach not start the application from scratch,
>> but to use the scaffolding application: db.py, layout.html, 
>> web2py_ajax.html.
>>
>> To have good possibility to upgrade between web2py versions, it is good 
>> to do no or minimal changes to previous files.
>> So I try to make my own database model: db_model.py, isntead of change 
>> the db.py, and so on.
>> Some minimum changes in previous files are still neccesary - which is bad 
>> :( - but I mark them with some comments like ### my_patch ###.
>>
>> My question is:
>> How (where) to properly call my javascript and my css files?
>>
>> For own javascript it can be done inside the view inside the <body>, 
>> maybe on the top, and maybe with help of {{include...}}
>> Am I correct?
>>
>> But what about own css layout? Is it possible to connect it outside of 
>> the files above? Lets say in own model file?
>>
>> Maybe this will help to other people too.
>> Thanks.
>>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to