I also agree that py4web would give much better performance.
Web2py is easy so i dont think your friend will face much problem
converting the application to web2py.
I have converted an app I wrote in flask to web2py and was able to do so.
The actual conversion i.e. database, html, css was a breeze,
i have disable registration
i have registered two admin. and added extra fields company_name and status
I want these two admin to be able to register others and pass the
company_name to each user they register
Example
Admin 1 company is xyz so when he register other users their company_name
s
I should be able to see "My orders"?
I have:
> Not Authorized
> Privilegios insuficientes
El martes, 14 de julio de 2015, 11:44:29 (UTC-5), Massimo Di Pierro
escribió:
>
> I made another simple online store: https://github.com/mdipierro/estore3
>
> Can you help me test, suggest improvement,
i am using the web development with python and web2py part2 video, creating
a reddit_clone.
When i use the web2py database populate command to add fields to comm table
i get a foreign key constraint from
this line Field('parent_comm','reference comm'),
when Field('parent_comm','reference comm')
I use web2py with GAE.
This is a snippet of my index.html
{{ =response.title }}
When I don't use a routes.py I have got a page but without pics and
css marking. My URL in this case is localhost:8080/lyc/default/index/
news.
Where can I find a description of the framework, or UML diagrams? I'm
not quite clear about its architecture.
On 5 фев, 03:25, Jonathan Lundell wrote:
> On Feb 4, 2011, at 2:28 PM, walter wrote:
>
>
>
> > I define a decorator into the modules folder and try get requ
I define a decorator into the modules folder and try get request.args.
How to do correct import of request and use it in my decorator?
I try something like this:
env = globals()
args = env.request.args
My previous post has look ambiguous enough. I use GAE to run my web2py
application.
I'm using GAE. Is there a possibility to perform a redirect back to a
page where I have come to perform authentication?
Many thanks. I've understood where is my error.
When I do next in the action:
def check():
if request.args(1) == None:
table = request.args(0)
return dict(table=table)
And my url has a trailing slash after a function argument (i.e.
applictation/controller/function/argument/) I catch an internal error
everytime.
I confused. Wha
My solution lies below, but I think it not quite elegant.
def edit():
'''
>>> request.args.append('news')
>>> request.args.append(None)
>>> request.extension = 'html'
>>> from gluon.storage import Storage
>>> user = dict(reset_password_key='',
... first_name='t
P.S. My test code strongly elementary
>>> assert(edit()['form'] != None)
True
>>> try:
... edit()
... except HTTP, http: print http.headers, session.auth
My code has shown above.
I try to use CRUD. Below my code sample.
if request.args(1) == None:
form=crud.create(db[request.args(0)])
else:
form=crud.update(db[request.args(0)],request.args(1))
return dict(form=form)
I whant to test my code, but everytime I get next:
Failed example:
try:
edit()
ex
Is there something like PEP for web2py?
I have to create several decorators for controllers. They needs only
for particular application. Where should I place them? In the modules
or in the models or in the site-packages? What way is more
web2pythonic?
Many thanks
This is my code. I specifically made it so primitive.
def index():
'''
>>> db.news.insert(title="Test", body="Test-test")
'''
return dict(table="news")
Next code is my db:
db.define_table('news',
Field('title'),
Field('body', 'text'),
Field('created_at',
Excuse me. May be I'm stupid, but I don't understand how to test next
case. I want to test that a response.status really has 303.
Bit of my code:
def show():
if request.args(0) == None:
redirect(URL('index'))
How should I write a doctest for this?
I want to create a unified view file for multiple application. I plan
to use it with the different design templates.
On 26 янв, 21:06, Anthony wrote:
> On Wednesday, January 26, 2011 12:56:56 PM UTC-5, rochacbruno wrote:
>
> Also, Walter, I don't know what your variable is, but if
Into the "modules" folder I created file (call it myfile.py for
example). Into this file there is a variable "title". This variable
contains value that is common for all pages of my application.
If import var = local_import('myfile') and return dict(var=var) all be
OK.
But with many controllers I'
This value lives in my file in the modules folder.
I want to set common value for all pages. If do it manually, that is,
the probability of error, if I forget to do it.
Is there any option to regular automatically add some value to the
dictionary returned by the controller?
It is the web2py/site-packages. OK! Many thanks.
In the model? Really? It's curiously enough. I have thought I should
to create file with my code and place it in a certain, according to
the specification, place.
Where can I placed my middleware code that is common for the different
controllers and would used by them?
Is there possibility to change the standard URL of the form
http://my_site.net/application/default/action to something like
http://my_site.net/default/action?
Question about a shell. Can I interact to controllers and views as
easy as a DB? If it is true, how?
> but the problem is that you have two controllers. Perhaps you should have
> only one.
I have thought about it. Unfortunately, I need sometimes show all our
customers but at the next time I need view all them trips. I would be
glad to do merge two controllers into the one. But I cannot figure ou
I have two controllers which differ only a database table title. For
example:
default/persons/index
persons = db(db.person).select()
return dict(persons=persons)
default/trips/index
trips = db(db.trip).select()
return dict(trips=trips)
How implement DRY conception in this case?
I have another one question. How to interact with controller in shell?
This is my code
def index():
form = SQLFORM(db.article)
if form.accepts(request.vars): response.flash = "Статья добавлена"
articles = db().select(db.article.ALL)
return dict(articles=articles, form=form)
I can't understand how to test index? How to test articles value for
example?
Where can I read more detailed about it? Is there it in the web2py
book?
I want to ask what folders should be accessible for writing?
Which folders should be set to permissions 644?
Who must to be owner all folders and files?
I have not asked the previous question correctly. I wanted to ask what
folders should be accessible for writing and for which permission must
be set to 644?
Who must to be owner all folders?
What permissions should I install?
On 4 янв, 16:27, mdipierro wrote:
> This may be a permission issue as web2py cannot access the file system
> (either looking the wrong folder or unable to read/write).
>
> On Jan 4, 7:21 am, walter wrote:
>
> > I have used thehttp://
I have used the http://web2pyslices.com/main/slices/take_slice/76 as
an example. But when I try to call the "http://w2p.edu/welcome/default/
index" I get a page with the next text: "Internal error
Ticket issued: unknown".
Thank you!
On Aug 5, 3:36 am, mdipierro wrote:
> Yes you can include only the template engine (gluon/template.py). It
> has a function render that is documented therein.
>
> On Aug 4, 10:41 pm, Walter wrote:
>
> > All,
> > is it (1) possible or (2) advisable to use
ively, including controller AND template engine?
Thanks
Walter
39 matches
Mail list logo