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
"
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 I
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', 'in
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)
- https://code.google.com/p/web2py/issues/lis
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 contr
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)
---
Method I
c = [(1, 'NURSERY'), (2, 'LKG'), (3, 'UKG'), (4, '1')]
key=3
>>> for i, j in c:
... if i==key: print j
UKG
Method II
-
c = [(1, 'NURSERY'), (2, 'LKG'), (3, 'UKG'), (4, '1')]
r = dict((x[0],x[1]) for x in c)
print r[3]
UKG
Method III
--
Anything better than
Why am I getting this error when using the "extract_mysql_models.py" script?
Given below is the traceback.
C:\Documents and Settings\rupeshpradhan\Desktop\scripts>python
extract_mysql_models.py rupesh:password@rockvale
Traceback (most recent call last):
File "extract_mysql_models.py", line 106
form=SQLFORM.factory(Field('selector',requires=IS_IN_SET(select_data),default=2))
That works fine, however if i have my select_data as given below
select_data = [(1, 'NURSERY'), (2, 'LKG'), (3, 'UKG'), (4, '1')]
The code works fine.
Is there a way (in fact, is there a need?) to make the defaul
select_data = [(1, 'first'), (2, 'second')]
form=SQLFORM.factory(Field('selector',requires=IS_IN_SET(select_data)))
form.vars.selector=2
Is this the correct way to set the default to 'second' by using the
statement form.vars.selector=2?
I want to generate a form like this
first
second
by supplying data in the format like this to SQL form factory.
select_data = [(1, 'first'), (2, 'second')]
How do i achieve this?
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
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 fie
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.
C:\Do
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',
S
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\scripts>python
extract_mysql_models.py rupesh:password@rock
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.
I have web2py_win_1.91.6 and Windows XP Professional OS
I could not find the folder or file under web2py folder? Where is it?
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, cont
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
I want using the data below, generate a table:
header=['roll', 'name', 'absent']
data=[['1', ''], ['2', ''], ['3', ''], ['4', '']]
Roll
Name
Absent
(
All)
1
2
3
4
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 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'))
db.define_table('add
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 tabl
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
Thanks a lot for sharing the philosophy behind coding!!! I get the point.
Now for some *real* help by nitpicking at my coding!
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")
I upgraded to 1.91.6. The problem still exists.
If the server dialog box is shut down abnormally, by clicking the
close button without clicking the stop server button first, does this
kind of a problem arise?
Rupesh
On Jan 19, 8:59 pm, Massimo Di Pierro
wrote:
> Please upgrade. 1.91.4 has known
Ok.
Thanks for the response.
On Jan 19, 8:59 pm, Massimo Di Pierro
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 wrote:
>
>
>
> > My Computer Configuration:
&g
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
Wh
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 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 wrote:
>
>
>
> > I have two computers networked together using LAN ca
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 throug
35 matches
Mail list logo