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

Retrieving a record into the Masterlist using SQLFORM.grid selectable constructor

Good day to all members here in stackoverflow and to all expert level in web2py! This is about the School Year, Student List (Masterlist) and Organization Fines using the existing code that @Anthony Anthony gave me. these are my database: lets start…
MeSH
  • 101
  • 1
  • 10
0
votes
1 answer

In web2py, how to find a row from rows given its id?

I have query= (db.mytable.ref_other_table==other_table_id) rows=db(query).select() How can I find a row in rows, knowing the records id, for instance, I can do ix=0 while rows[ix].id != id: ix+=1 but is this the most efficient way?
Ben Law
  • 58
  • 6
0
votes
1 answer

How to remove row from rows object, not from database?

I have a rows object and want to delete a row from it, similar to removing items from a list. Regular python method rows.remove(row) doesn't work and I don't want to use DAL's built in delete methods since they delete the whole record.
DiMarzio
  • 153
  • 1
  • 10
0
votes
1 answer

How to download videos after they have been uploaded with web2py

I am using web2py for my college project. I have managed to upload a video into my database (by uploading it into 'uploads files'). But the problem is I don't know how to access that uploaded video afterwards. Can someone explain me how can I…
0
votes
1 answer

Posting a list to a web2py database

I have a simple web2py app that implements a RESTful API. In my model, I have something like: db.define_table('vehicles', Field('flightId', type='string', default='00000', length=128, . . …
RYS
  • 442
  • 6
  • 22
0
votes
1 answer

web2py real time specific table

For example in the controller I have the following query: a= db().select(db.my_db.ALL) How can I add in view a button, such that in real time it shows only the rows which have the field a.date bigger than the date that is selected by the user. I…
spoke
  • 257
  • 1
  • 6
  • 19
0
votes
1 answer

How to download (zip) file in web2py with jQuery ajax

A zip file is written in 'download_data' and there is no error or download response upon returning.  Notes: The printed data returned from the function appears to be zipfile data I have not augmented or utilized download.stream or response.download…
ballade4op52
  • 2,142
  • 5
  • 27
  • 42
0
votes
1 answer

Insert multiple data using SQLFROM.grid with selectable signature in another table

Good day to all stackoverflow web2py Guru's here.... I found this link and its 2 years old now. I have a problem and I don't know how to code it. I have 2 Entities(Tables) and it's a M:M relationship First table: The Instructors (Advisers) Second…
MeSH
  • 101
  • 1
  • 10
0
votes
1 answer

web2py how to: Ajax to send dropdown menu's value to action

I have a working dropdown menu, and I can send its value to a function using "submit" button. It's quite clumsy however, as user always has to press the button, wait for the page to load and it refreshes the page so the user loses all other…
DiMarzio
  • 153
  • 1
  • 10
0
votes
1 answer

web2py: FOREIGN KEY constraint failed when it shouldn't

I have this table: db.define_table('block', Field('ore_id', 'reference ore'), Field('location', type='integer', required=True, notnull = True), Field('x', type='integer'), Field('y', type='integer'), Field('block_mass_tn',…
DiMarzio
  • 153
  • 1
  • 10
0
votes
1 answer

Web2py grid column order rehashed each time

Recently I am leveraging Web2py framework plus python in my web programming. SQLFORM.grid is the best thing happened to Web2py, but after deploying the page with SQLFORM.grid, every time the user refreshes it, the table columns get rehashed,…
0
votes
2 answers

web2py database configuration

I found this line to help configure Postgresql in web2py but I can't seem to find a good place where to put it : db = DAL("postgres://myuser:mypassword@localhost:5432/mydb") Do I really have to write it in all db.py ?
John Doe
  • 1,570
  • 3
  • 13
  • 22
0
votes
1 answer

sending mail in web2py

I'm trying to send a mail in web2py but nothing happens. Here is my code: from gluon.tools import Mail mail = Mail() def sendMail(): mail.settings.server = 'smtp.yahoo.com:465' mail.settings.sender = 'mymail@yahoo.com' …
spoke
  • 257
  • 1
  • 6
  • 19
0
votes
0 answers

Reference field in a web2py record contains a 0 before it is inserted despite it’s representation does not equal 0

A reference field in a web2py record contains a 0 before it is inserted despite it’s representation does not equal 0. To explain in more detail, you see below a function and a table definition in a web2py model. The table contains bookings of staff…
JDi
  • 131
  • 1
  • 1
  • 5
0
votes
1 answer

Web2py manage user registration key pending status

I am hosting web2py for a client and don't want to give out web2py admin access. There are multiple applications running in web2py. All of them require approval for registered useraccounts. I would like to have a control which allows app admins to…
Dennis Bauszus
  • 1,624
  • 2
  • 19
  • 44
1 2 3
99
100