Questions tagged [web2py]

web2py is a open-source full-stack web framework written in Python.

web2py is a free, open-source web framework for agile development of secure database-driven web applications; it is written in Python.

web2py is a full-stack framework. It includes an ORM (called the Data Abstraction Layer), its own template engine and typical form widget helpers and controls.

Created by a team of professionals and academics, one of its key principles is no backward incompatible changes. Development is led by Massimo Di Pierro, Associate Professor in Computer Science at DePaul University in Chicago.

Additional resources:

  1. Project Website
  2. Documentation
  3. Source Code
  4. Sample Websites
  5. Wikipedia Page
  6. Google Group

Simple Example (from What is web2py?):

Model Definition:

db=DAL('sqlite://storage.db')
db.define_table('image', 
    Field('name'),
    Field('file','upload'))

Controller:

def index():
    form = SQLFORM(db.image)
    if form.process().accepted:
        response.flash = 'image uploaded'
    return dict(form = form,counter=None,_class='boxCode')

View:

{{extend 'layout.html'}}
<h1>Image upload form</h1>
{{form}}
2141 questions
0
votes
1 answer

Grab array from div text to plot with ChartJS

I'm new with programming, so please go easy if I'm not clear with my explanation... In a Web2Py view I have a div with an id="convgraphdata" containing numbers that I would like to plot with ChartJS. The numbers vary depending on inputs but look…
Sam
  • 1
  • 1
0
votes
1 answer

web2py-@auth.requires() error: 'NoneType' object has no attribute

I have add code in my db.py to add extra field before the auth.define_tables(username=False, signature=True): auth.settings.extra_fields['auth_user'] = ( [Field('user_type',label="reg_type",default="Stu", requires=IS_IN_SET(['Stu,…
Yibing Liu
  • 21
  • 5
0
votes
1 answer

uwsgi web2py daemonize background process

I have web2py application with controller which is starting some background process like below: def run_backproc(): subprocess.call('setsid sh dosomething.sh >/dev/null 2>&1 < /dev/null &', shell=True) return True The problem is when web2py…
jurkij
  • 155
  • 2
  • 9
0
votes
1 answer

Why deleted record ignores its format in web2py?

I have a table: db.define_table('mytable', Field('name', 'string'), Field('is_active', 'boolean', writable=False, readable=False, default=True), format='%(name)s') for which I have enabled record versioning. Later I create a grid for…
Lben
  • 83
  • 1
  • 12
0
votes
2 answers

What is the correct way to build complex queries in web2py's DAL?

I am using web2py's DAL and trying to do the equivalent of this MySQL query. SELECT header.tag, detail.site FROM header LEFT OUTER JOIN detail ON header.id= detail.header WHERE header.tag IN ('abc', 'def', 'xyz') I presumed that the DAL…
ChrisGuest
  • 3,398
  • 4
  • 32
  • 53
0
votes
1 answer

web2py page reload with jQuery AJAX

I'm working a college project which basically requires building a simple news website to fetch tweets from Twitter. I chose Tweepy as my Python library for this task. To achieve this news website, I have a table called 'tweet_source' which stores…
Arjun
  • 817
  • 3
  • 16
  • 28
0
votes
1 answer

How to setup web2py enviroment for unittest

I have the following directory structure: web2py/applications/myapp web2py/applications/myapp/controllers/account.py web2py/applications/myapp/models/db.py web2py/applications/myapp/tests/runner.py web2py/applications/myapp/tests/test_account.py In…
user2829759
  • 3,372
  • 2
  • 29
  • 53
0
votes
1 answer

reactive.js + displaying boards

I can't seem to understand why I can't spam click my "create board" button and keep creating boards when I add a board the new empty board dict should be prepended to the front of the array but only one board will show up then no more..Thanks for…
ajanakos
  • 99
  • 1
  • 9
0
votes
1 answer

how to choose first row when use group by in web2py

I have a table in db. and when i use this code results = db().select(db.project.ALL, orderby=db.project.id, groupby=db.project.status) I can only choose the last row in repeats. how could i choose the first one?
killzane
  • 1
  • 2
0
votes
1 answer

web2py: How to update form field value onvalidation

I have a sample which looks quite like the one in the web2py-docs: http://web2py.com/books/default/chapter/29/07/forms-and-validators#onvalidation models/db.py: db.define_table('numbers', # Field('user_id', 'reference auth_user'), …
dpat
  • 253
  • 3
  • 9
0
votes
1 answer

SQLFORM export redirects to input form

I have an application where the user must choose which table he/she wants from a mysql database and it becomes visible in a SQLFORM grid. Nevertheless when the user tries to export the table, for example in csv format the page redirects to the input…
0
votes
1 answer

Is it possible to create a CRUD Form based on many tables on web2py?

I am trying to mantain some info scattered across 6 tables using web2py. I have read that web2py have a CRUD component? that allows to make CRUD operations on a given table. I was thinking if it was possible to create one form with some of the model…
Lben
  • 83
  • 1
  • 12
0
votes
1 answer

web2py,TypeError: an integer is required

I am using the follow to highlight a date field where the date is greater then the current date. db.stock_task.ESI_withhold_until_date.represent=lambda v, row:SPAN(datetime.date(v),_class='withhold' if v and v> …
0
votes
1 answer

Web2py angularjs module

I have a problem with just trying to make an AngularJS module work in web2py. specifically this cart: http://ngcart.snapjay.com/docs I read online that you have to change the delimiters in AngularJS which I did. (I resorted to changing the Angular…
YummyTree
  • 59
  • 8
0
votes
1 answer

how to make custom paging in web2py depend on bootstrap?

I want to make custom paging using web2py and bootstrap How to implement model and controller and view in a custom method without using default method like below The default way is: def index(): …