This is the table definition:
db.define_table('school_session',
Field('school_session', 'reference session_master'),
Field('admission_number', 'integer', notnull=True),
Field('class_name', 'reference class_master'),
Field('roll_number', 'integer', notnull=True))
This is the
Also, is there a way of making the entire form read only without having to
make 'writable = False' for each field in that form?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
The table definition:
db.define_table('student',
Field('admission_number', 'integer', notnull=True, unique=True),
Field('name', 'string', length=255, notnull=True))
db.define_table('school_session',
Field('school_session', 'reference session_master'),
Field('admission_number',
Model
db.define_table('student',
Field('admission_number', 'integer', notnull=True, unique=True),
Field('name', 'string', length=255, notnull=True))
Controller
student = db.student(row.id)
form = SQLFORM(db.student, student, readonly=True)
All the three fields of the table show up when
Please give a suggestion too.
--
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
So, do you think it is better to avoid using reserved words completely and
avoid the headache afterwords?
--
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)
Yes, the script is buggy, alright.
To begin with, the field ID was supposed to be skipped altogether according
to the code. The line
if field[0] == 'id':
should have been
if field[0].lower() == 'id':
for the ID field to be skipped successfully.
Anyway, its a relief that the my app does not
I have web2py_win_1.91.6 and Windows XP Professional OS
I have web2py_win_1.91.6 and Windows XP Professional OS.
Or do you mean the script folder is in the source code version of Web2Py? I
am downloading that now and checking it.
Okay, I found it.
The .py file was in the src version of web2py.
Anyway, the script is giving the following error, whereas the original
script worked fine.
Given below is the traceback.
C:\Documents and Settings\rupeshpradhan\Desktop\scriptspython
extract_mysql_models.py
I made the table definition script using the script that was in the
following post:
https://groups.google.com/d/topic/web2py/AnJ0iPH0WaI/discussion
of an existing MySQL table.
web2py_win_1.91.6 did not complain about the following table definition and
work just fine.
db.define_table('admin',
The script 'extract_mysql_models' provided in the script folder of the src
version of web2py is giving the following error.
The original script that was first given in the URL below worked fine.
https://groups.google.com/d/topic/web2py/AnJ0iPH0WaI/discussion
Given below is the traceback.
That's probably because I used a script to generate a DAL script using a
script that was written 2 years ago (2009)!!!
URL: https://groups.google.com/d/topic/web2py/AnJ0iPH0WaI/discussion
Anyway, what is you recommendation, Massimo?
1. Do I change my table definition script and remove the ID
I could not find the folder or file under web2py folder? Where is it?
Sweet! Boriel!!
Just what the doctor ordered!
Hey, If you happen to polish the script any further and have a new version
of the same, just remember, I am here to put it to good use. I have
subscribed to this thread, so that I know if you have put up anything here.
Also, Massimo, have you put
The 'input_sheet.py' module placed in site-packages:
def write_to_file(file_name, content):
file = open(file_name, 'w')
file.write(content)
file.close()
def main():
file_name = 'output.txt'
content = 'This is the output text.'
return file_name, content
if __name__ == '__main__':
file_name,
I want using the data below, generate a table:
header=['roll', 'name', 'absent']
data=[['1', ''], ['2', ''], ['3', ''], ['4', '']]
table width=200 border=1
tr
th scope=colRoll/th
th scope=colName/th
th scope=colpAbsent/p
p
label(
input type=checkbox name=absentall id=absentall
Can anyone recommend a good python forum in google groups or elsewhere?
How about you show me couple (say 5) of the database structures of the
applications that you have already written? I can go through it and get some
practical ideas.
I am trying to standardize my naming schemes for my database, table and
fields. I am trying to follow the one given below. Please share with me your
scheme.
Standard Database Table Naming Scheme
=
Table name:
---
small caps with underscore
look-up
I have seen that before. Its about python coding style.
I am trying to discuss database table and field naming style here.
Care to comment on the following table structure, please:
db.define_table('lu_address_type',
Field('name'))
db.define_table('contact',
Field('name'))
Thanks a lot for sharing the philosophy behind coding!!! I get the point.
Now for some *real* help by nitpicking at my coding!
Thanks a lot MARTIN for the nitpick. REALLY needed that!
Inspite of what you mentioned that you are relatively new to web2py, that
was a lot of help.
I don't know if other are going to help me out as much as you did. But since
you did take the trouble to pore through my code, I was hoping that
I am trying to learn how to download text/csv files.
This test function works fine.
def download():
# import and assign handle
import cStringIO
content = cStringIO.StringIO()
# write dummy content
for i in range(0, 10):
content.write(This is the text+\r\n)
Ok.
Thanks for the response.
On Jan 19, 8:59 pm, Massimo Di Pierro massimo.dipie...@gmail.com
wrote:
Please upgrade. 1.91.4 has known bugs. If you still have the problem,
we will look furtherinot this.
On Jan 18, 9:59 pm, Rupesh Pradhan rupeshkrprad...@gmail.com wrote:
My Computer
My Computer Configuration:
CPU: Intel
Motheboard: ASUS
OS: Windows XP Profession, SP2
Web2Py version: 1.91.4 (2010-12-22)
Why am I getting this error?
WARNING:root:failure to stat applications\admin\sessions\127.0.0.1-
f6f76cfb-49b1-4b04-af6b-f0fae01c7d5d: expected a character buffer
object
The following link from the web2py online book is not working.
http://adal.chiriliuc.com/mod_wsgi/revision_1018_2.3/mod_wsgi_py25_apache22/mod_wsgi.so
Any alternate URL?
Rupesh
OK. I will give it a try and get back to you
On Dec 7, 8:13 pm, mdipierro mdipie...@cs.depaul.edu wrote:
When you start web2py you need to specify the IP address
web2py.py -i 192.168.0.1 -p 8000 -a 'password'
On Dec 7, 5:28 am,RupeshPradhan rupeshkrprad...@gmail.com wrote:
I have two
I have two computers networked together using LAN cable with name
'server'(192.168.0.1) and 'machine01'(192.168.0.2)
I have installed web2py on the 'server'. After running the
'web2py_no_console' on the server (the http://localhost:8000 shows the
welcome page), I tried to access the webpage
29 matches
Mail list logo