[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 -

[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),

[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

[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. --

[web2py] Re: returning values from custom form

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

[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

[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 -

[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] 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

[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 sending

Re: [web2py] Email Registration

2016-01-12 Thread Tom Russell
ce > 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 <vara...@gmail.com> wrote: >&

Re: [web2py] Email Registration

2016-01-09 Thread Tom Russell
e for the email > > 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 >&

[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] 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

[web2py] Re: DAL Select

2014-08-18 Thread Tom Russell
= db(db.voltrin.startdate == mydate).select()[0] or better: row = db(db.voltrin.startdate == mydate).select().first() .first() returns None in case no records are returned, which would cause an error when using a subscript. Anthony On Monday, August 18, 2014 11:09:37 AM UTC-4, Tom Russell

[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

[web2py] Re: Scheduler

2014-06-05 Thread Tom Russell
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 since my app is hosted on pythonanywhere and according to the book I need to do it from

[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 div id=wrapper for my layout.html. I tried adding this but it does not seem to work. Is there an easy way to do this? Thanks.

[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: DAL/Decorator for specific data

2014-05-29 Thread Tom Russell
, 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 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

[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: 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 UTC+2, Tom Russell wrote: I

[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

[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

[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 Russell wrote: I have a simple form where I have

[web2py] Re: Redirect to grid page

2014-05-27 Thread Tom Russell
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 grid page in place which is where I go now. The grid though has a lot of records and I just want to go to that last record in that grid. Since its pagination thats what I

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
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 tsrda...@gmail.com javascript:wrote

Re: [web2py] Accessing records

2014-05-20 Thread Tom Russell
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 fetching a row section. I can ensure that there is records

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 tsrda...@gmail.com javascript:wrote: I have a table which I insert data from the internet, just 4

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 last_five_records be, a list or something I could iterate

[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'),

[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

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

2013-06-28 Thread Tom Russell
fieldset 2013/6/28 Tom Russell t...@caregointl.com 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.emergencycontacts.insert

[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] Re: confused about db.py settings

2013-06-28 Thread Tom Russell
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, Ales On Friday, June 28, 2013 5:05:50 PM UTC+2, Tom Russell wrote: I am confused about how I have my db.py

[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))

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

2013-06-28 Thread Tom Russell
, 2013 6:59:19 PM 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 creating a new db_wizard.py in my model

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 abasta...@gmail.com 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 =

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 cjk...@gmail.com wrote: I have two tables something like this: db.define_table('item', Field('name'), Field('on_hand',

Re: [web2py] Re: JQuery Issue

2013-06-27 Thread Tom Russell
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 one. This is my form code: @auth.requires_login() def register_patient(): mark_not_empty(db.patient) mark_not_empty

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 ato.st...@gmail.com 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 t...@caregointl.com wrote: Thats weird, now

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 t...@caregointl.com wrote: k thanks I will try that On Thu, Jun 27, 2013 at 10

[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

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', 'Alert Dialog'); and nothing shows up, could it be that the jquery

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

2013-06-27 Thread Tom Russell
Ramos ramstei...@gmail.com wrote: Using this suggestion , my submit button is inside the last fieldset. How do i take it outside? 2013/6/26 Tom Russell t...@caregointl.com To group inside a field I do something like this with 3 different tables: form=SQLFORM.factory(db.patient

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
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.smartgrid(db.patient, deletable=True, editable=True, create=False, maxtextlength=64, paginate=25, links=links, links_in_grid=True, linked_tables

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
method is just to specify a format attribute for db.patient, which will be used by any referencing fields. Anthony On Wednesday, June 26, 2013 1:06:03 AM UTC-4, Tom Russell wrote: Another question on the smartgrid. I have linked tables in my smartgrid like: grid = SQLFORM.smartgrid

Re: [web2py] Re: SQLFORM.smartgrid

2013-06-26 Thread Tom Russell
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 do not want to expose the id field on the grid Field('alternatepid', label='Alternate PID', writable=False, readable=False

[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] 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] #

[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,

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 ramstei...@gmail.comwrote: That is a very clever solution. Saved my day. Thank you 2013/6/26 Tom Russell t

[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 type 'exceptions.TypeError' lambda() takes exactly 1

Re: [web2py] Appointment Manager

2013-06-26 Thread Tom Russell
a well formatted json object with simplejson dump. Richard On Wed, Jun 26, 2013 at 12:55 PM, Tom Russell t...@caregointl.com wrote: I am using the appointment manager from https://github.com/mdipierro/web2py-appliances/tree/master/AppointmentManager . I have tweaked it to my needs

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

2013-06-26 Thread Tom Russell
Another solution can be: {{extend 'layout.html'}} h2Education CV/h2 div id='form1'{{=education_form}}/div h2Student/h2 div id='form1'{{=student_form}}/div h2School/h2 div id='form1'{{=school_form}}/div On Wed, Jun 26, 2013 at 12:47 PM, Tom Russell t...@caregointl.com wrote: Saved mine too

Re: [web2py] Appointment Manager

2013-06-26 Thread Tom Russell
/mdipierro/web2py-appliances/tree/master/AppointmentManager Richard On Wed, Jun 26, 2013 at 1:31 PM, Tom Russell t...@caregointl.com wrote: Well I updated to the latest fullcalendar and it seems to work good, but do not know if the memory leak still exists. By any chance could you share what

[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)

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
://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 with a link, open the other app and have

[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

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 abasta...@gmail.com wrote: On Tuesday, June 25, 2013 10:12:32 AM UTC-4, Tom Russell wrote: Well agreed, but I set that up

Re: [web2py] Re: Confused about app

2013-06-25 Thread Tom Russell
no attribute 'auth_user' On Tue, Jun 25, 2013 at 11:14 AM, Anthony abasta...@gmail.com 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 welcome app, just modified the html

[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,

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 t...@caregointl.com wrote: Well agreed, but I set that up in the welcome app so it would seem like

Re: [web2py] Re: Smartgrid Links

2013-06-25 Thread Tom Russell
, 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 wrote: I have a smartgrid with a link like so: links = [lambda row: A(T('Create Appointment'),_href=URL

[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

[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: Change form layout

2013-06-24 Thread Tom Russell
/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 required to be filled out, how do I set it so its like 3-4

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 the layout a little easier to navigate. I do not have a html

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
) 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 of this some place? Thanks On Mon, Jun 24, 2013 at 9:55 AM, Anthony abas

Re: [web2py] Re: Change form layout

2013-06-24 Thread Tom Russell
Russell wrote: Thanks again for the info. I guess I still do not get it though if I set my formstyle to table3cols would'nt my form at least be laid out like: Name Address City State Or am I not looking at this correctly? On Mon, Jun 24, 2013 at 10:16 AM, Anthony abas...@gmail.com wrote

[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)

Re: [web2py] Re: SQLForm Factory

2013-06-24 Thread Tom Russell
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? This is the code for my controller. I have tried to set it in several

Re: [web2py] Re: SQLForm Factory

2013-06-24 Thread Tom Russell
(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: form=SQLFORM.factory(db.**patient(fields=['first_name'])**, db.emergencycontacts, db.dependents, formstyle = 'table3cols

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 abasta...@gmail.com 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 field to not be readable like

[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

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
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. What I want to see on the form is the value shown up but just as plain text so the user

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
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='MRN', writable=False, readable=True, requires=IS_NOT_EMPTY()), Still just

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
can still 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 controller which works for what I need

Re: [web2py] Re: Form Field

2013-06-24 Thread Tom Russell
= some_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 so I am not sure where that leaves me

[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

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 niph...@gmail.com 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

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,

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 villa...@gmail.com wrote: I don't believe you can use SQLFORM in that way, you'll have to create your own form - maybe try

Re: [web2py] Re: nyroModal

2011-11-06 Thread Russell McMurray
' % record_id_goes_here)}} class=nyroEdit target=_blankname_goes_here/a It works for me. 2011/11/5 Kenneth Lundström kenneth.t.lundst...@gmail.com Hi Russell, Have you defined nyroModalRemove somewhere? I'm getting parent.$.nyroModalRemove is not a function when using your suggested three lines

[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 ross.peop...@gmail.com wrote: I am trying to provide

[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...

[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 /

[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 =

[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',

[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 richard_gor...@verizon.net wrote: I'm using components, not typical web2py way of doing things. On Jan 16, 3:51 am, Kenneth Lundström kenneth.t.lundst...@gmail.com

[web2py] Re: postgresql error ... class 'psycopg2.ProgrammingError'(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 carlosgali...@gmail.com 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
(request.vars,session):            score = sum((check(a.answer,request.vars.get('a%s'%i,'')) for i,a in enumerate(asked))            # do something with score     return dict(form=form) On Aug 22, 6:04 pm, Russell russell.mcmur...@gmail.com wrote: In my experience, it is a bit awkward to do this using

[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.id0).select() import random random.seed() asked = random.sample(rows, 3)) form=SQLFORM.factory(

[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 gunanar...@gmail.com 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

[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,

[web2py] Re: Downloading from private folder

2010-06-23 Thread Russell
If you look at the ReportLab example in chapter 9 of the book, it uses the private folder to make the PDF file, which is then deleted. So I guess that private is for temporary working stuff - a folder that can be cleaned out if necessary. And, if such a file is worth keeping, I guess it should

  1   2   >