[web2py] Re: SQLFORM.grid question

2017-04-26 Thread Jim Russell
On Tuesday, April 25, 2017 at 9:19:59 AM UTC-5, Anthony wrote: > > On Tuesday, April 25, 2017 at 3:20:23 AM UTC-4, Jim Russell wrote: >> >> I worked around this by setting the wltype field to string and adding >> a requires=IS_IN_SET. This makes the editing page have a d

[web2py] Re: SQLFORM.grid question

2017-04-25 Thread Jim Russell
I worked around this by setting the wltype field to string and adding a requires=IS_IN_SET. This makes the editing page have a dropdown with the set members instead of a free-form text field. So it's working, but it's not the most elegant solution. -- Resources: - http://web2py.com - http://we

[web2py] SQLFORM.grid question

2017-04-24 Thread Jim Russell
Hi all. I'm having an issue with an SQLFORM.gird query. I have a table where one of the columns references another table. Here are the table definitions: db.define_table('osrwhitelistpool', Field('id', type='id'), Field('pool', type='string', length=255, unique=True), Field('wltype',

[web2py] Re: check boxes with is_in_set

2016-12-12 Thread Jim Russell
In your example, list_chart is not a list of strings, it is a list of tuples. In my code, hostnames is just a list of hostnames. e.g. ('hostname1.example.com','hostname2.example.com') I assume that you are trying to make the checkboxes default to true. For me, they defaulted to being checked.

[web2py] Re: check boxes with is_in_set

2016-12-08 Thread Jim Russell
Rob, I used this code to get a list with checkboxes. form=SQLFORM.factory( Field('hostnames',"list:string", default=hostnames,widget=SQLFORM.widgets.checkboxes.widget,requires=[IS_IN_SET(hostnames,multiple=True),IS_NOT_EMPTY()])) hostnames is a list containing strings. -- Resource

[web2py] Re: returning values from custom form

2016-11-26 Thread Jim Russell
ot;amazon","localhost"] >> >> marcados = request.post_vars["host"] >> >> return dict(host_names=host_names,marcados=marcados) >> >> The view: >> >> >> {{for host in host_names:}} >> {{=host}} >>

[web2py] returning values from custom form

2016-11-25 Thread Jim Russell
Hi. I have created a form which takes a list of hostnames and shows the hostnames with checkboxes next to it. The idea is to be able to uncheck any hostnames and pass the still checked hostnames to another function which will then act on that list of hostnames. The problem is that it just retu

[web2py] Re: 502 Bad Gateway - no tmp/web2py.socket file

2016-11-25 Thread Jim Russell
> > $ ps aux | grep "uwsgi" > richard 1044 0.0 0.1 4276 1824 pts/0S+ 10:54 0:00 grep > --color=auto uwsgi > That is the grep process, not uwsgi. So uwsgi is not running. Check in /var/log/nginx/ for any messages about uwsgi -- Resources: - http://web2py.com - http://web2py.

[web2py] Re: Email not working

2016-02-19 Thread Tom Russell
Yea I have the user/pw correct, the smtp settings seem pretty straight forward as well so not sure what the root cause is. On Friday, February 12, 2016 at 4:10:20 PM UTC-5, Dave S wrote: > > > > On Friday, February 12, 2016 at 12:17:57 PM UTC-8, Tom Russell wrote: >> >>

[web2py] Re: Email not working

2016-02-12 Thread Tom Russell
: > > web2py uses smtplib. as long as on the other side there's an > smtp-compatible interface, there's no reason to blame web2py :P > > On Friday, February 12, 2016 at 8:38:38 PM UTC+1, Tom Russell wrote: >> >> I have since my last time trying to get email

[web2py] Email not working

2016-02-12 Thread Tom Russell
I have since my last time trying to get email sending working with the built in registration process moved to Amazon AWS SES mail services which I know works well with other people. I have put in all the required info in db.py needed but still cannot send an email. I have tried gmail, a few oth

Re: [web2py] Email Registration

2016-01-12 Thread Tom Russell
service > use the site and the problem > > Il giorno sabato 9 gennaio 2016 22:52:17 UTC+1, Tom Russell ha scritto: >> >> Yea I have a premium account with pythonanywhere. >> >> On Saturday, January 9, 2016, Alessio Varalta wrote: >> >>> Maybe is a pr

Re: [web2py] Email Registration

2016-01-09 Thread Tom Russell
gt; Il giorno sabato 9 gennaio 2016 21:41:31 UTC+1, Tom Russell ha scritto: >> >> >> Hi, >> >> I have everything in place according to the docs to do the email >> registration process. However every time I try it in the error log it just >> says email not sen

[web2py] Email Registration

2016-01-09 Thread Tom Russell
Hi, I have everything in place according to the docs to do the email registration process. However every time I try it in the error log it just says email not sent and then a print out of what the email would have looked like had it been sent. I have no idea why I cannot get this to work. I

[web2py] Re: DAL Select

2014-08-18 Thread Tom Russell
> > On Monday, August 18, 2014 11:09:37 AM UTC-4, Tom Russell wrote: >> >> I have some simple code that is suppose to grab data from a row in my db >> table. >> >> I do it like: >> >> row = db(db.voltrin.startdate == mydate).select() >> vwtrin = r

[web2py] DAL Select

2014-08-18 Thread Tom Russell
I have some simple code that is suppose to grab data from a row in my db table. I do it like: row = db(db.voltrin.startdate == mydate).select() vwtrin = row.vw_trin I have run this and verified mydate and whatever other variables I have are something other than null but I cannot seem to get th

[web2py] PythonAnywhere Web2py Script

2014-07-16 Thread Tom Russell
I am trying to run a script that I have in my app. While the log files seem to show my script ran, it does not update the db I have for my app. On the schedule tab in pythonanywhere I have this set up so not sure if it is correct: python2.7 /home/tsrdatatech/web2py/web2py.py -S ttheorydataextra

[web2py] layout

2014-06-05 Thread Tom Russell
I want to use a few parts from a layout for web2py here http://www.web2py.com/layouts/static/plugin_layouts/layouts/CorporateOffice/index.html Mainly I just want the for my layout.html. I tried adding this but it does not seem to work. Is there an easy way to do this? Thanks. -- Resources:

[web2py] Re: Scheduler

2014-06-05 Thread Tom Russell
e and their associated actions. > > On Wednesday, June 4, 2014 11:00:06 AM UTC-4, Tom Russell wrote: >> >> I have implemented the scheduler per the info and examples in Chapter 4 >> of the book. I am trying to start the workers but my problem is I am not >> sure how to si

[web2py] Scheduler

2014-06-04 Thread Tom Russell
I have implemented the scheduler per the info and examples in Chapter 4 of the book. I am trying to start the workers but my problem is I am not sure how to since my app is hosted on pythonanywhere and according to the book I need to do it from the interface from where you set the ip and port.

[web2py] Re: ValueError: invalid literal for int() with base 10:

2014-05-29 Thread Tom Russell
awesome, worked. On Thursday, May 29, 2014 3:41:12 PM UTC-4, Niphlod wrote: > > drop the table and recreate it. It's a known issue with sqlite. > > http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#SQLite > > On Thursday, May 29, 2014 9:34:28 PM U

[web2py] ValueError: invalid literal for int() with base 10:

2014-05-29 Thread Tom Russell
I am getting the following error when inserting a new record for a table I have. I cannot seem to pinpoint what the cause is at this time. The error is: Traceback (most recent call last): File "/home/tsrdatatech/web2py/applications/ttheorydataextractor/controllers/appadmin.py", line 270, in

[web2py] Re: DAL/Decorator for specific data

2014-05-29 Thread Tom Russell
gt; there would be any benefit over the simple approach above. > > Anthony > > On Wednesday, May 28, 2014 11:00:13 AM UTC-4, Tom Russell wrote: >> >> I have read through the docs but have not come across what I am trying to >> do, if its possible. >> >> I have

[web2py] DAL/Decorator for specific data

2014-05-28 Thread Tom Russell
I have read through the docs but have not come across what I am trying to do, if its possible. I have a table with 40 columns of data, I want to use a decorator or similar to only allow some of them viewable while others in a different membership group can see all of the columns. Is this somet

[web2py] Re: Redirect to grid page

2014-05-27 Thread Tom Russell
w if this doesn't work and I'll code up a test of my own to see > what happens. > > Anyone have a more efficient way of doing this? > > -Jim > > > > On Tuesday, May 27, 2014 11:32:28 AM UTC-5, Tom Russell wrote: >> >> Jim, >> >> Yes I have a gri

[web2py] Re: Redirect to grid page

2014-05-27 Thread Tom Russell
, Jim S wrote: > > When you say that you want to go to the 'grid' page, do you mean a page > with a SQLFORM.grid on it and you want to go into 'edit' mode on a specific > record on the grid? > > -Jim > > > On Tuesday, May 27, 2014 10:42:31 AM UTC-5, Tom

[web2py] Redirect to grid page

2014-05-27 Thread Tom Russell
I have a simple form where I have a submit button that runs some code. After the code runs and the data is inserted into my table I do a simple redirect like so: redirect(URL('voltrin_data')) That just goes to a page I have set up with a grid. I notice if I am editing a record and press submit

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
Woks perfect, thank you. On Tuesday, May 20, 2014 11:17:12 AM UTC-4, Anthony wrote: > > It is a Rows objects, so yes, you can iterate over it. > > Anthony > > On Tuesday, May 20, 2014 11:06:34 AM UTC-4, Tom Russell wrote: >> >> Thanks. >> >> What would l

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
Thanks. What would last_five_records be, a list or something I could iterate over? Tom On Tuesday, May 20, 2014 10:16:54 AM UTC-4, Johann Spies wrote: > > > > > On 20 May 2014 16:11, Tom Russell >wrote: > >> I have a table which I insert data from the internet,

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
ou explain in more detail what you are actually trying to do? > > Anthony > > On Tuesday, May 20, 2014 9:32:27 AM UTC-4, Tom Russell wrote: >> >> Thanks for the comments. I read Chapter 6 which is where I got the bit of >> code to access the records. Specifically the fetch

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
e one it is grabbing to do a calculation on it. It is not too clear in the book how I should be getting a record by the id is what I think my problem is. Thanks, Tom On Tuesday, May 20, 2014 4:53:13 AM UTC-4, Johann Spies wrote: > > On 19 May 2014 22:06, Tom Russell >wrote: > > I

[web2py] Accessing records

2014-05-19 Thread Tom Russell
Hi, I have some records in my db that I need to access to get them and perform some calculations on. My code to access the records is: rows = db(db.voltrin.id > 0).count() currentrow = rows - 4 for x in range(currentrow, rows): record = db.voltrin(db.voltrin.id==x)

[web2py] Form Action

2014-05-16 Thread Tom Russell
I have a form that is not connected to a db table. Its a simple form: def getdata_form(): form=FORM('Start Date:', INPUT(_id='startdate', _name='date', _class='date'), 'End Date:', INPUT(_id='enddate', _name='date', _class='date'),INPUT(_type='submit'), _action=URL('grabvoltrindata'))

[web2py] AppAdmin Link

2014-05-13 Thread Tom Russell
I have in my default.py this code for a button to call appadmin: {{=A(T("App Admin"), _href=URL('appadmin', scheme='https'), _class='btn', _style='margin-top: 1em;')}} But when I click on the button it defaults to /default/appadmin instead of just appadmin. How do I set this properly? Also

[web2py] SQLite Data

2014-05-13 Thread Tom Russell
I used csvstudio to process data to the existing sqlite db in web2py. It all went very well and now the data is there. The dates however for a date column only show up with the word None. Is there something else I am missing for the date not to be showing correctly or at all? Thanks, Tom --

Re: [web2py] Where to find name of uploaded file during the onvalidation step?

2013-11-06 Thread Russell McMurray
At onvalidation the file is "inside" the form as cStringIO.StringO instance. Specifically: form.vars.{{upload_fieldname}}.file. You can get the contents like this: contents = form.vars.{{upload_fieldname}}.file.getvalue() It is then up to you to throw an error (or not as the case may be) with f

Re: [web2py] updating multiple tables - how to have all updates in the same transaction?

2013-06-28 Thread Tom Russell
I could be wrong and am still new here but maybe SQLFORM.Factory? Thats what I use on a form that has 2 tables. On Fri, Jun 28, 2013 at 1:41 PM, Cliff Kachinske wrote: > I have two tables something like this: > > db.define_table('item', > Field('name'), > Field('on_hand', integer), > ) > >

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
Nice, I will check that out. On Fri, Jun 28, 2013 at 1:37 PM, Anthony wrote: > Yea thanks I tried that as well with no luck. > > > Then you're doing something else wrong. It might help if you show all of > the code. If you have a model file that does: > > db = DAL(...) > ... > auth = Auth(db) >

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
UTC+2, Tom Russell wrote: >> >> Yea thanks I tried that as well with no luck. >> > > That's impossible. But never mind, hang in there, after you finish your > first project, you'll be remembering this beginnings with a smile. > > >> I ended up just

[web2py] Passing an arg

2013-06-28 Thread Tom Russell
I have a smartgrid with a link in it like this: links = [lambda row: A(T('Create Appointment'),_href=URL("default", "appointment_create",args=[row.id]))] And I pass that to this function: @auth.requires_login() def appointment_create(): record = db.patient(request.args(0)) db.appointment

Re: [web2py] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
auth in > one database, then you stop using it and use another database, which has no > auth set up. That can't work. > > Simply define db just once, not twice. Use the definition web2py has > suggested for you and change the database name if you want to. > > Regards, >

[web2py] confused about db.py settings

2013-06-28 Thread Tom Russell
I am confused about how I have my db.py set up for tables etc. At the top I have what is generated for me: if not request.env.web2py_runtime_gae: ## if NOT running on Google App Engine use SQLite or other DB db = DAL('sqlite://storage.sqlite',pool_size=1,check_reserved=['all']) else:

Re: [web2py] sqlform.factory widget in field problem

2013-06-28 Thread Tom Russell
t; 2013/6/28 Tom Russell > >> Here's the rest of my code doing what I posted before... >> >> if form.process().accepted: >> id = db.patient.insert(**db.patient._filter_fields(form.vars)) >> form.vars.patient=id >> id = >> db.

Re: [web2py] sqlform.factory widget in field problem

2013-06-27 Thread Tom Russell
tyle,form)) On Thu, Jun 27, 2013 at 5:31 PM, António Ramos wrote: > Using this suggestion , my submit button is inside the last fieldset. > How do i take it outside? > > > 2013/6/26 Tom Russell > >> To group inside a field I do something like this with 3 different tables: >&

Re: [web2py] Re: JQuery Issue

2013-06-27 Thread Tom Russell
on in > your page (with javascript) that is preventing the execution of your stuff > later on. > > -Jim > > On Thursday, June 27, 2013 10:26:56 AM UTC-5, Tom Russell wrote: > >> So If I do something like: >> >> jAlert('This is a custom alert box', 

[web2py] Use model in another app

2013-06-27 Thread Tom Russell
I have 2 apps and one I want to use the model/db from it in the other in a SQLFORM.grid. I have read through and googled and cannot find a way to do this. Is this possible and how? Thanks, Tom -- --- You received this message because you are subscribed to the Google Groups "web2py-users" gr

Re: [web2py] Re: JQuery Issue

2013-06-27 Thread Tom Russell
So If I do something like: jAlert('This is a custom alert box', 'Alert Dialog'); and nothing shows up, could it be that the jquery lib is not being made available? On Thu, Jun 27, 2013 at 11:00 AM, Tom Russell wrote: > k thanks I will try that > > > > On

Re: [web2py] Re: JQuery Issue

2013-06-27 Thread Tom Russell
k thanks I will try that On Thu, Jun 27, 2013 at 10:58 AM, Jim Steil wrote: > I'd try putting some alert() messages in to try to trace the flow and > check the values of variables. > > > > On Thu, Jun 27, 2013 at 9:53 AM, Tom Russell wrote: > >> Thats wei

Re: [web2py] Re: JQuery Issue

2013-06-27 Thread Tom Russell
#x27;).hide(); >}); > }); > }); > > > On Wednesday, June 26, 2013 9:09:00 PM UTC-5, Tom Russell wrote: >> >> I cannot seem to get some jquery code to work right and not sure why. >> Basically when I click a checkbox I want another field to appear below that &

[web2py] JQuery Issue

2013-06-26 Thread Tom Russell
I cannot seem to get some jquery code to work right and not sure why. Basically when I click a checkbox I want another field to appear below that one. This is my form code: @auth.requires_login() def register_patient(): mark_not_empty(db.patient) mark_not_empty(db.emergencycontacts) m

Re: [web2py] Appointment Manager

2013-06-26 Thread Tom Russell
>> "{{=T('October')}}", >> "{{=T('November')}}", >> "{{=T('December')}}"], >> dayNames: ["{{=T('Sunday')}}", >>

Re: [web2py] sqlform.factory widget in field problem

2013-06-26 Thread Tom Russell
Another solution can be: {{extend 'layout.html'}} Education CV {{=education_form}} Student {{=student_form}} School {{=school_form}} On Wed, Jun 26, 2013 at 12:47 PM, Tom Russell wrote: > Saved mine too, got it originally from > http://www.web2pyslices.com/slice/show/1457

Re: [web2py] Appointment Manager

2013-06-26 Thread Tom Russell
>> a simple json feed function returning a well formatted json object with >> simplejson dump. >> >> Richard >> >> >> On Wed, Jun 26, 2013 at 12:55 PM, Tom Russell wrote: >> >>> I am using the appointment manager from >>> https://gith

[web2py] Appointment Manager

2013-06-26 Thread Tom Russell
I am using the appointment manager from https://github.com/mdipierro/web2py-appliances/tree/master/AppointmentManager . I have tweaked it to my needs and works well so far but there is an issue trying to use SQLFORM.grid. I get an error () takes exactly 1 argument (2 given) by doing this: def

Re: [web2py] sqlform.factory widget in field problem

2013-06-26 Thread Tom Russell
Saved mine too, got it originally from http://www.web2pyslices.com/slice/show/1457/adding-fieldset-and-legend-to-forms On Wed, Jun 26, 2013 at 12:39 PM, António Ramos wrote: > That is a very clever solution. > Saved my day. > > Thank you > > > > > 2013/6/26 Tom

[web2py] Ref another table in another app

2013-06-26 Thread Tom Russell
How would I do this: I need to create an appointment for a patient so from my list of patients i have a link to call another app to do the appointment. I have the link set so it looks like this: links = [lambda row: A(T('Create Appointment'),_href=URL("AppointmentManager","default", "appointment_

Re: [web2py] sqlform.factory widget in field problem

2013-06-26 Thread Tom Russell
To group inside a field I do something like this with 3 different tables: form=SQLFORM.factory(db.patient, db.emergencycontacts, db.dependents) fs0=form[0][:26] #patient rows fs1=form[0][26:37] #emergency contacts fs2=form[0][37:41] #dependents fs3=form[0][-1] # submi

[web2py] Add button to smartgrid?

2013-06-26 Thread Tom Russell
I need to add a button to the smartgrid but not like doing create=True because I have a form factory that has 2 other tables associated with the one. I know in html I can simply add a line for a button but since I am not using html for this how would I add a button to that page to reference my own

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
"represent" attribute > for any reference fields that reference this table. > > Anthony > > > On Wednesday, June 26, 2013 10:24:32 AM UTC-4, Tom Russell wrote: > >> db.define_table('patient', >> #db.patient.id.readable=False # Since we

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
7;Son', 'Daughter', 'Other'])), ) db.define_table( 'emergencycontacts', Field('patient','reference patient', writable=False, readable=False), Field('em_first_name', label='First Name'), Field('em_mi

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
IN_DB(db,'field.id > ','%(patient)s')), > > > On Wednesday, 26 June 2013 10:36:03 UTC+5:30, Tom Russell wrote: >> >> Another question on the smartgrid. >> >> I have linked tables in my smartgrid like: >> >> grid = SQLFORM.smartgri

[web2py] SQLFORM.smartgrid

2013-06-25 Thread Tom Russell
Another question on the smartgrid. I have linked tables in my smartgrid like: grid = SQLFORM.smartgrid(db.patient, deletable=True, editable=True, create=False, maxtextlength=64, paginate=25, links=links, links_in_grid=True, linked_tables=['emergencycontacts','dependents']) When clicking on t

Re: [web2py] Re: Smartgrid Links

2013-06-25 Thread Tom Russell
("AppointmentManager", "yourcontroller", "appointment_create", args=[ > row.id]) > > You can also used keyword arguments "a", "c", and "f" with URL(). > > Anthony > > On Tuesday, June 25, 2013 12:08:57 PM UTC-4, Tom Russell wr

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
Ah, I forgot to add the following line to my consumer app: auth = Auth(db,cas_provider = ' http://127.0.0.1:8000/welcome/default/user/cas') On Tue, Jun 25, 2013 at 10:12 AM, Tom Russell wrote: > Well agreed, but I set that up in the welcome app so it would seem like > that sho

[web2py] Smartgrid Links

2013-06-25 Thread Tom Russell
I have a smartgrid with a link like so: links = [lambda row: A(T('Create Appointment'),_href=URL("AppointmentManager","appointment_create",args=[ row.id]))] grid = SQLFORM.smartgrid(db.patient, deletable=True, editable=True, create=True, maxtextlength=64, paginate=25, links=links, links_i

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
ect has no attribute 'auth_user' On Tue, Jun 25, 2013 at 11:14 AM, Anthony wrote: > On Tuesday, June 25, 2013 11:04:22 AM UTC-4, Tom Russell wrote: > >> Yes I customized welcome and then added a new app via the admin >> interface. I did not directly copy the welc

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
did implement the CAS stuff but now I get an error saying 'DAL' object has no attribute 'auth_user' for the app I have. On Tue, Jun 25, 2013 at 10:53 AM, Anthony wrote: > On Tuesday, June 25, 2013 10:12:32 AM UTC-4, Tom Russell wrote: > >> Well agreed, but I set

[web2py] Multi Table Form

2013-06-25 Thread Tom Russell
I have the following form that uses 3 different tables and when I submit the data it all seems to submit correctly but when I view the data in a smart grid with linked tables in the columns clicking on the link does not show any record for the row of linked data. My smartgrid code: def manage_pat

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
> http://web2py.com/books/default/chapter/29/09#Central-Authentication-Service > > Il giorno martedì 25 giugno 2013 07:51:08 UTC+2, Tom Russell ha scritto: > >> So I took and modified the welcome app to my needs and added another app. >> If I login with the welcome app and

[web2py] Confused about app

2013-06-24 Thread Tom Russell
So I took and modified the welcome app to my needs and added another app. If I login with the welcome app and with a link, open the other app and have it set with auth.requires_login(), it requires the user to login again. How does one handle this stuff in web2py? Do I need another app the way I ha

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
ome_value > db.mytable.myfield.writable = False > > Anthony > > On Tuesday, June 25, 2013 1:02:40 AM UTC-4, Tom Russell wrote: > >> Yes I understand that. What would be the best way to handle this? >> Seemingly, the couple of items suggested did not work for me s

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
l submit > a value for that field if they are determined, so you might want to check > for that variable on the server and delete it if submitted. > > Anthony > > > On Tuesday, June 25, 2013 12:15:04 AM UTC-4, Tom Russell wrote: > >> I ended up doing this in the

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
t; use the method I showed (i.e., set the default value for the field before > creating the form). > > Anthony > > > On Monday, June 24, 2013 11:23:01 PM UTC-4, Tom Russell wrote: > >> Yes I tried that: >> >> Field('medical_record_number', label=&#x

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
readable at True in order to show the value but not allow it to be > edited. > > Anthony > > > On Monday, June 24, 2013 11:00:59 PM UTC-4, Tom Russell wrote: >> >> I have a form and I load a pre existing value that I generate internally >> before I call the form. Wh

[web2py] Form Field

2013-06-24 Thread Tom Russell
I have a form and I load a pre existing value that I generate internally before I call the form. What I want to see on the form is the value shown up but just as plain text so the user cannot modify it. If I do readable-False then it just shows None for the value rather than the value. How would I

Re: [web2py] Re: SQLForm Factory

2013-06-24 Thread Tom Russell
Ah yes both readable and writable have to be defined. Thanks again On Mon, Jun 24, 2013 at 6:12 PM, Anthony wrote: > Try writable=False. > > > On Monday, June 24, 2013 6:04:43 PM UTC-4, Tom Russell wrote: > >> Thanks for the tip. >> >> I did set one f

Re: [web2py] Re: SQLForm Factory

2013-06-24 Thread Tom Russell
individual fields instead of entire tables: > > SQLFORM.factory(db.mytable.myfield, db.mytable.myotherfield, db.wholetable > ) > > Anthony > > > On Monday, June 24, 2013 11:49:43 AM UTC-4, Tom Russell wrote: > >> I tried doing the specific fields like: >> >> f

Re: [web2py] Re: SQLForm Factory

2013-06-24 Thread Tom Russell
ctory() can take a list of specific fields rather than entire tables. > > Anthony > > > On Monday, June 24, 2013 11:15:28 AM UTC-4, Tom Russell wrote: >> >> If I have a form factory with 3 tables, how would I define the fields I >> wanted shown for each? >> >>

[web2py] SQLForm Factory

2013-06-24 Thread Tom Russell
If I have a form factory with 3 tables, how would I define the fields I wanted shown for each? This is the code for my controller. I have tried to set it in several spots but all of them throw an error. def register_patient(): mark_not_empty(db.patient) mark_not_empty(db.emergencycontacts

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
Ah, I see now. Thanks On Mon, Jun 24, 2013 at 10:50 AM, Anthony wrote: > No, 3 columns means: > > Col 1 Col 2 Col 3 > label widget comment > > It's still one field per row. When in doubt, try it out. :-) > > Anthony > > > On Monday, June 24, 201

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
LFORM(..., formstyle=myformstyle) > > Anthony > > > On Monday, June 24, 2013 10:07:49 AM UTC-4, Tom Russell wrote: > >> Thanks for the responses. >> >> The formstyle looks interesting but I cannot make heads or tails out of >> the way to use it. Are there any examples

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
> > > On Monday, June 24, 2013 9:35:31 AM UTC-4, Tom Russell wrote: > >> Thanks for the response. So now I am really confused because I have no >> idea where to put this code if I am using a SQLFORM.factory? >> >> Basically I just want to add row fluid to make t

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
/d/msg/web2py/QmoRmapiOwA/tZqeEbii6QgJ > > Anthony > > > On Monday, June 24, 2013 8:53:16 AM UTC-4, Tom Russell wrote: >> >> I have a SQLForm and use the formset DIV for it but its not what I really >> want. Rather than having just one column with all of the fields req

[web2py] Change form layout

2013-06-24 Thread Tom Russell
I have a SQLForm and use the formset DIV for it but its not what I really want. Rather than having just one column with all of the fields required to be filled out, how do I set it so its like 3-4 columns? For example: Name Address City State Instead of: Name Address City State

Re: [web2py] Re: SmartGrid

2013-06-19 Thread Tom Russell
aha that would be it. On Wed, Jun 19, 2013 at 5:26 PM, Niphlod wrote: > are you logged-in ? > For security reasons any modification to tables in grids is prevented on > anonymous access. > You can still give "write permissions" using user_signature=False, but > it's highly discouraged > > On We

Re: [web2py] Re: 3 forms in 1

2013-06-18 Thread Tom Russell
Yes I am using smartgrid elsewhere, very nice. I did do the 3 forms but used the factory to do it. Works nicely so far. On Tue, Jun 18, 2013 at 1:24 PM, villas wrote: > I don't believe you can use SQLFORM in that way, you'll have to create > your own form - maybe try SQLFORM.factory. Better s

Re: [web2py] 3 forms in 1

2013-06-18 Thread Tom Russell
Yes I was just reading and understood that the reason for my fields not showing up was because the fields in many of the tables have the same names. Changing that resolved that issue. It's actually a great book too, just wished I could read faster. Thanks. On Tue, Jun 18, 2013 at 1:04 PM, Richa

Re: [web2py] Re: nyroModal

2011-11-06 Thread Russell McMurray
It works for me. 2011/11/5 Kenneth Lundström > Hi Russell, > > Have you defined nyroModalRemove somewhere? I'm getting > "parent.$.nyroModalRemove is not a function" when using your suggested > three lines. > > > Kenneth > > return_sc

[web2py] Re: Strange Error: Field does not belong to the table

2011-06-16 Thread Russell
Looks like the form.accepts is trying to update the database with the is_administrator value. You may need to deal with the update explicitly. Have you tried form.accepts(request.vars, session, dbio=False)? On Jun 14, 1:21 pm, Ross Peoples wrote: > I am trying to provide an editor for auth_use

[web2py] Re: Need advice on Cron in production

2011-05-17 Thread Russell
Yes, I have two lines in the crontab. A five minute one, and a daily one... */5 * * * * python /home/www-data/web2py/web2py.py -S init -M -N -R / home/www-data/web2py/applications/init/modules/scripts/cron_fivemin.py 1 22 * * 1-5 python /home/www-data/web2py/web2py.py -S init -M -N -R / home/www

[web2py] Re: Need advice on Cron in production

2011-05-17 Thread Russell
This works for me. I have a system crontab like this... */5 * * * * python /home/www-data/web2py/web2py.py -S init -M -N -R / home/www-data/web2py/applications/init/modules/cron.py And cron.py runs just like it should. Here's a basic layout that you can use to test it's working... ==modules/cr

[web2py] Re: Best practice to start background process

2011-04-27 Thread Russell
I think that a simple system cron is the most reliable (per minute, per hour, per day). Then use some type of locking mechanism in your web2py script (either database or file). For example: locked = db((db.report_queue.status=='SystemLock')).select().first() if not locked: locked = db.report

[web2py] Re: SQLFORM.factory - RuntimeError: you must specify a Field(...,uploadfolder=...)

2011-03-29 Thread Russell
I've just been struck by the same issue when upgrading to Version 1.94.6 (2011-03-27 18:20:38). To be clear, this used to work, but does NOT work anymore: form=SQLFORM.factory(Field('document', 'upload')) This works on the current version: form=SQLFORM.factory(Field('document', 'upload', uploadfo

[web2py] Re: prevent post on reload

2011-01-16 Thread Russell
This JavaScript will refresh the page without reposting the data: window.location = window.location; On Jan 17, 4:04 am, weheh wrote: > I'm using components, not typical web2py way of doing things. > > On Jan 16, 3:51 am, Kenneth Lundström > wrote: > > > But isn t web2py taking care of this alr

[web2py] Re: postgresql error ... (relation "auth_user" already exists)

2010-11-16 Thread Russell
Hi, I've had this problem come up quite a few times. It appears to be a migration issue and is usually fixed by this... auth.define_tables(migrate=False) Thanks Russell On Nov 17, 8:48 am, Carlos wrote: > Hi Massimo, > > I'll send you the requested files if/when I get

[web2py] Re: build a row base questionnaire

2010-08-23 Thread Russell
;',limitby=(0,3)) >     form=SQLFORM.factory(*[Field('a%s'%i, label = a.question) for i,a > in enumerate(asked)]) >     if form.accepts(request.vars,session): >            score = sum((check(a.answer,request.vars.get('a%s'%i,'')) > for i,a in en

[web2py] Re: build a row base questionnaire

2010-08-22 Thread Russell
In my experience, it is a bit awkward to do this using SQLFORM. You could try something like this: db.define_table('q_and_a', Field('question'), Field('answer')) rows = db(db.q_and_a.id>0).select() import random random.seed() asked = random.sample(rows, 3)) form=SQLFORM.factory( Fi

[web2py] Re: Weird Behavior - Query returning zero rows when it should return all rows

2010-08-18 Thread Russell
Use 'T' or 'F' rather than 'True' of 'False'. Web2py saves boolean data as 'char' with length 1. On Aug 19, 1:49 am, Narendran wrote: > Hi, > I added a new boolean field to a table. And I manually updated the > value of the field outside web2py. Now, I get zero rows for any > condition I put on

[web2py] Re: upload bug in filename

2010-06-24 Thread Russell
As an aside, the mixing of \\ and / is unsightly but does not seem to cause a problem on widows. If you want to tidy it up, it's around line 786 of main.py: request.folder = os.path.join(request.env.web2py_path, 'applications', request.application) + '/' On Jun 25, 11:15 am, Y

[web2py] Re: dynamically growing form?

2010-06-23 Thread Russell
I would create a form with all 10 rows, hide all but the first 2 rows, and then use jquery to progressively display the rest of the rows. Add something like this to each of the rows... form.element(_id=this_reference_id).append( A(' add', _href='#', _onclick="jQuery('#%s').show()" % next_reference

  1   2   >