[web2py] db and variables

2010-06-30 Thread Rick
Hi, I'm trying to write loops in db.py: letters = ['a', 'b', 'c', 'd'] for i in range(len(letters)): for j in range(len(letters)): db.define_table('connection'+letters[i]+letters[j], SQLField('smthng', db.???letters[i])) What should I use instead

[web2py] generating a table

2010-07-02 Thread Rick
Hi, I want to generate a table like this: db.define_table(objects[i], SQLField(locus), SQLField(before) SQLField(after) SQLField(name) SQLField(main_name) ...with a code similar to this : obj

[web2py] Initiating table

2010-07-03 Thread Rick
Hi, I would like to link a table to its own model like this: db.define_table('person', Field('name'), Field('child', db.person)) I understand that I should first initiate the table and then link it to itself. But how to do that? Thanks in advance for help

[web2py] submit many forms

2010-07-11 Thread Rick
Hi, Let's say that there are a number of forms on the same page. There would be no problem to put a submit button after each of them, but how to submit all forms at the same time with one single submit button? Thanks in advance for help!

[web2py] variable into db.table.field

2010-07-12 Thread Rick
Hi, Let's say that in a controller file there are three variables (a, b and c) each of them contains a string. In a model file there is a table called 'Table' that has three fields (a_id, b_id and c_id). My question is how to: 1. Check in the database if there already is a 'Table'-object with an

[web2py] loop generated forms

2010-07-12 Thread Rick
Hi, How to generate multiple forms with a loop? In my controller file there are forms generated with this loop: thing=[one, two, three] def theFunction(): for thing1 in varibale1: form=FORM(':', INPUT(_name='name')

[web2py] Re: loop generated forms

2010-07-12 Thread Rick
#x27;:', INPUT(_name="name")) >      listf.append(form) > return dict(listf=listf) > > Yet I usually use SQLFORM and add a submit button > > As this is my firts answer to a coding question, do not hesitate to > tell if I'm wrong > > On 12 juil, 22:26, Rick

[web2py] Re: loop generated forms

2010-07-13 Thread Rick
This gives no error: dict()[x] = [x] ..but my web page is still not shown in the browser, it's just printed "None". Maybe the controller-file-code is correct but something should be added to the view file? On Jul 13, 12:19 am, Jonathan Lundell wrote: > On Jul 12, 2010, at 3

[web2py] Re: loop generated forms

2010-07-14 Thread Rick
1:56 PM, Rick wrote: > > > This gives no error: > > dict()[x] = [x] > > ..but my web page is still not shown in the browser, it's just printed > > "None". Maybe the controller-file-code is correct but something should > > be added to the view file? >

[web2py] web2py install on nginx?

2010-02-23 Thread rick
Can anyone share his experience installing and working with web2py on nginx? Which if the best install approach? fastcgi? Any hints will be appreciated, Brgds -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to

[web2py] Re: NGINX + FCGI + web2py = routes.py not working correctly

2010-02-23 Thread rick
Hi Ahmed, Can you share with us how you got web2py running on nginx with fastcgi? brgds On Feb 23, 2:12 pm, Ahmed Sameh wrote: > Hi All, > > I have configured web2py to work with NGINX through FCGI, and > everything works fine except for routes.py. > > I am using routes.py to redirect various s

[web2py] Re: web2py install on nginx?

2010-02-23 Thread rick
Thanks ;) On Feb 23, 11:43 pm, Ahmed Sameh wrote: > Hi rick, > > I have installed it but there is a problem using routes.py with NGINX > +FCGI , I have posted about that earlier. > But using NGINX + CherrPy + web2py works fine and you can find many > other posts discussing that

[web2py] database question

2010-09-23 Thread rick
Hi, I'm having trouble figuring out the syntax for this type of database inquiry. I have three tables: 1) stores, which has a name 2) regions, which has a 2-letter abbreviation 3) store-region, which puts stores in certain regions. I want to pass in a 2-letter region abbreviation, and receive bac

[web2py] JQuery plugin

2010-09-24 Thread Rick
Hi, I'd like to make a button that generates a sound when clicking on it. This JQuery plugin was the best way I could found: http://plugins.jquery.com/project/sound and I wrote this code: views/default/index.html: {{extend 'layout.html'}} onClick="jQuery(this).sou

[web2py] Re: JQuery plugin

2010-09-24 Thread Rick
in a div,  you should use , or > another element, and the file URL should be build with URL helper: > > views/default/index.html: >        {{extend 'layout.html'}} >         >             >  onclick="jQuery(this).sound.play({{=URL('static',args

[web2py] Re: JQuery plugin

2010-09-25 Thread Rick
1935182323... > > If you're serious about using jQuery properly, it'll be the best 30$ > you ever spent. Sure learned a lot from it. > > On Sep 24, 4:13 pm, Rick wrote: > > > > > Hi, > > > I'd like to make a button that generates a sound when c

[web2py] GAE address

2010-09-28 Thread Rick
Hi, When I upload my app with GAE the address will be myapp.appspot.com/ myapp . On the site myapp.appspot.com there is the administrative interface that doesn't work with GAE. My question is: how to put my app on myapp.appspot.com ? Thanks in advance for help!

[web2py] superfish

2010-09-28 Thread Rick
Hi, I've put this into a viewer file named layout.html but it doesn't work: {{response.files.append(URL(request.application,'static','superfish.js'))}} {{include 'web2py_ajax.html'}} ...some code {{ response.menu=[

[web2py] Re: superfish

2010-09-29 Thread Rick
ierro wrote: > everything I see here appears correct. Can we see the generated html? > Can you try load the page with firebug and see if you get any error? > > On Sep 28, 11:50 pm, Rick wrote: > > > > > Hi, > > > I've put this into a viewer file

[web2py] Re: GAE address

2010-09-30 Thread Rick
On Sep 28, 5:46 pm, mdipierro wrote: > You have to upload it in your local copy and then doply it again. > > On Sep 28, 11:20 am, Rick wrote: > > > > > Hi, > > > When I upload my app with GAE the address will be myapp.appspot.com/ > > myapp . On the site myapp

[web2py] Re: GAE address

2010-10-01 Thread Rick
uncher > or appcfg.py > > This may also help: > > http://gluonframework.wordpress.com/2010/03/02/shell-only-web2py/ > > Massimo > > On Sep 30, 12:06 pm, Rick wrote: > > > But how to upload it in my local copy? I understand that I'd somehow > > get the

[web2py] list:string thoughts

2010-10-24 Thread rick
linked (many-to-one) to the products table, but I really don't know how I would even begin to do that in web2py.. Thanks for reading! - rick

[web2py:32796] Re: Error with Database (MySQL) when using latest release....

2009-10-13 Thread Rick
I have also come across this with web2py 1.67.2, using stock MySQL on Ubuntu 8.10, when I add unique=True to a string column in a table definition. On Sep 22, 11:13 am, Yannick wrote: > Hello mate, > Below you can find the error message that I received from Database > (MySQL) when using the lat

[web2py] simple db app

2010-12-13 Thread Rick
Hi, I'm trying to make a data base for storing names and addresses, but since I'm a n00b then I can't get it working. I've no idea what's wrong. The problem is that the input function doesn't redirect to the show function and that the show function doesn't show any data. Here's the code: the cont

[web2py] Re: simple db app

2010-12-13 Thread Rick
Thanks for the reply. Unfortunately this code idea gives the same result as mine. On Dec 14, 2:51 am, pbreit wrote: > I would envision something more like this (not tested): > > == db.py == > db.define_table('address', >     Field('person'), >     Field('address')) > > == default.py == > def inde

[web2py] Re: simple db app

2010-12-14 Thread Rick
s, session): >                 redirect(URL(r=request, > f='show',vars={'rid':form.vars.id})) >         return dict(form=form) > > On Dec 13, 10:48 pm, DenesL wrote: > > > > > > > > > Hi Rick, > > > On Dec 13, 6:55 pm, Rick wro

[web2py] auth model

2010-12-14 Thread Rick
Hi, I'm trying to make a very simple todo application for many users. The passwords and usernames would be given from a administrator, so hence there wouldn't be any registration through e-mail. My problem is that I don't know how to properly write the model/db.py file. I tried with this, where th

[web2py] Re: auth model

2010-12-15 Thread Rick
Thanks for the advice. This code seems to work: ** from gluon.settings import settings from gluon.tools import * # if running on Google App Engine if settings.web2py_runtime_gae: from gluon.contrib.gql import * # connect to Google BigTable db = DAL('gae') # and sto

[web2py] Re: auth model

2010-12-15 Thread Rick
request,args=args))}} {{pass}} {{include}} **** On Dec 15, 9:55 pm, Rick wrote: > Thanks for the advice. This code seems to work: > > ** > from gluon.settings import settings > from gluon.tools import * > > # if running on G

[web2py] interval in a list

2010-12-17 Thread Rick
Hi, In the database there are value records for 31 days. Now I'm trying to make a html file where a value is presented for each day of a week. The code below presents all the recorded values, and I don't know how to make it printing the 7 first records only, or the last 3 records. Thanks in advan

[web2py] Re: interval in a list

2010-12-17 Thread Rick
may work: > > for row in db().select(db.table.ALL, limitby=(0, 7)): >         print row.record > > for row in db().select(db.table.ALL, limitby=(0, 3). > orderby=~db.table.id): >         print row.record > > On Dec 18, 7:30 am, Rick wrote: > > > > > > > >

[web2py] Re: interval in a list

2010-12-17 Thread Rick
Sorry for spamming, but I want to be exact. Here is the final code, where n is the week number: {{for record in db().select(db.table.ALL, orderby=db.table.day, limitby=(n*0, n*7)):}} On Dec 18, 1:24 am, Rick wrote: > Thanks a lot! The final code looks like this: > {{for record in db().

[web2py] Re: interval in a list

2010-12-17 Thread Rick
Oh no, the code above failed. Here is the final code where n is the week number: {{for record in db().select(db.table.ALL, orderby=db.table.day, limitby=((n-1)*7, n*7)):}} On Dec 18, 1:30 am, Rick wrote: > Sorry for spamming, but I want to be exact. Here is the final code, > where n is th

[web2py] variables

2010-12-17 Thread Rick
Hi, I want to change the value of a variable by clicking on an tag, but can't find any information about the topic. I suppose the code would look something like this: {{=A('<', request n=n-1) }} Thanks in advance for help

[web2py] variables

2010-12-17 Thread Rick
Hi, I want to change the value of a variable by clicking on an tag, but can't find any information about the topic. I suppose the code would look something like this: {{=A('<', request n=n-1) }} Thanks in advance for help

[web2py] Re: variables

2010-12-17 Thread Rick
Thanks for the replies! The variable that I'm operating with is python type, not javascript. Mdipierro, your solution looks nice, but i can't get it working. The value of the variable doesn't seem to change. Here is my code: from views/default/index.html: {{n=1}} plus {{=n}} controller.py def plu

[web2py] Re: variables

2010-12-18 Thread Rick
; this: > > ==javascript== > $('#some_id).click(function() >   { >      $('#target").val( ($('#target").val()+1) ); >   } > ) > > ==html== > Click me > > 2 > > This should more or less work. > > On Dec 18, 10:02 am, Rick wrote: > >

[web2py] Re: variables

2010-12-18 Thread Rick
If "n" would be a global variable in a controller file, can I use something like this then? {{=n}} plus On Dec 18, 4:23 pm, Rick wrote: > Perhaps there is a way to get different variable values depending on > what address you load??? For example: > http:...default/ind

[web2py] reload a div

2010-12-20 Thread Rick
Hi, How to reload/update a div tag as that below with AJAX? {{=variable}} update the div Thanks in advance for replies.

[web2py] How to delete a user?

2010-12-30 Thread Rick
Hi, I don't know if the way I add users is proper, but it works. Now I try to write a tag for deleting users, and it doesn't work. Here is the code: ==in a controller file== def admin(): records = db().select(custom_auth_table.ALL, orderby=custom_auth_table.username) #records = S

[web2py] Re: How to delete a user?

2011-01-02 Thread Rick
= Auth(globals(), db) db.define_table( auth.settings.table_user_name, Field('username'), Field('password'), Field('registration_key', default='')) auth.define_tables() custom_auth_table = db[auth.settings.table_user_name] # get the custom_au

[web2py] Re: How to delete a user?

2011-01-02 Thread Rick
==session.username).delete() return 'the record has been deleted' ...but I don't know how to reload the page automatically after deleting a user. Any ideas? On Jan 2, 5:13 pm, Jonathan Lundell wrote: > On Jan 2, 2011, at 7:01 AM, Rick wrote: > > > > > I changed t

[web2py] Re: How to delete a user?

2011-01-02 Thread Rick
Thanks a lot! I find this being a good solution: ==in admin.html== {{=A(("Delete this user"), _href=URL('deleteusr'))}} ==in the controller file== def deleteusr(): db(custom_auth_table.username==session.username).delete() redirect(URL('admin')) On Jan 2, 8:19 pm, Jonathan Lundell

[web2py] Number of records

2011-01-02 Thread Rick
Hi, In addition to the records that are submitted with a SQLFORM, I want to give each record a specific "identification" number, so that the first record has number=1 and so on: ==from model/db.py== db.define_table('input', Field('number', 'integer'), Field('value', 'integer')) ..

[web2py] Re: Number of records

2011-01-03 Thread Rick
Thanks for the advice. I changed my code, but I don't know if I'm on the right track. Anyhow it doesn't work. ==in a model file== db.define_table('input', Field('value', 'integer')) class MyVirtualFields(object): def input_number(self): return self.input.value ==in

[web2py] Re: Number of records

2011-01-03 Thread Rick
gt; > db.input.virtualfields.append(MyVirtualFields()) > > 2. In controller use the setvirtualfields method of Rows > > ==in a controller file== > records = db(db.input.id>0).select() # or any other query > records.setvirtualfields(virtual=MyVirtualFields()) > > > > > >

[web2py] Re: Number of records

2011-01-03 Thread Rick
nd of loop in the controller file? On Jan 3, 7:39 pm, Rick wrote: > Thanks for the replies. Now I try to add the ability to delete > records, but it doesn't seem to work: > db(db.input.virtualfields==session.virtualfields).delete() > > > > > > > > >On Jan 3,

[web2py] Re: Number of records

2011-01-03 Thread Rick
Unfortunately the code bellow seems to be errors-prone: ==in a model file== class MyVirtualFields(object): def input_number(self): return some_variable db.input.virtualfields.append(MyVirtualFields()) >On Jan 3, 8:03 pm, Rick wrote: > Perhaps this would be a goo

[web2py] account for each user

2011-01-03 Thread Rick
Hi, I suppose that this is a very elementary question, but I can't find the solution. My question is -- how to make a account for each user? I've tried with this code, but it gives just one account for all user: ==on the model file== db.define_table( auth.settings.table_user_name, Field('u

[web2py] Re: Number of records

2011-01-14 Thread Rick
Thanks for the suggestion! The 'id' field looks like a smart solution. But there seem to be a problem -- This line creates an error when I add the 'id' field and 'migrate=False' to the day table: records = db().select(db.day.ALL, orderby=db.day.thedate) Any ideas? On Jan 4, 4:03 am, Fabiano wrot

[web2py] Re: Number of records

2011-01-15 Thread Rick
So the problem was that the controller file line creates an error when I add the 'id' field and 'migrate=False' to the day table. Here is some more code: ===in the model file=== import datetime now = datetime.date.today() db.define_table('day', Field('the_id', 'id'), Field('thedate

[web2py] Re: account for each user

2011-01-15 Thread Rick
;                                        email = email, >                                        password = crypt_pass > >                                        ) >             return id_user > > iduser = new_user('Chris','Mills','ch...@nobody.com','somepasswordhere') >

[web2py] Re: account for each user

2011-01-15 Thread Rick
Perhaps I should reformulate the problem -- I want to make one table for each auth-user, so that an auth-user can't see the records of ohters auth-users. On Jan 15, 11:52 pm, pbreit wrote: > I may not understand either. The user authentication functionality is > automatically provided by web2py

[web2py] Re: account for each user

2011-01-15 Thread Rick
): session.flash = 'saved.' redirect(URL('admin')) return dict(form=form, records=records) On Jan 16, 1:08 am, Rick wrote: > Perhaps I should reformulate the problem -- I want to make one table > for each auth-user, so that an auth-user can't s

[web2py] Re: account for each user

2011-01-15 Thread Rick
{{=request.args(0).replace('_',' ').capitalize()}} {{=form}} {{if request.args(0)=='login':}} {{pass}} >On Jan 16, 3:24 am, Rick wrote: > ...or maybe the problem lies int this function in the controller file: > def admin(): >         rec

[web2py] Re: account for each user

2011-01-16 Thread Rick
ate', default=request.now), Field('value', 'integer'), Field('theauth', auth.settings.table_user)) On Jan 16, 4:58 am, Rick wrote: > Hurray, I'm getting somewhere now! Thanks pbreit, now I try to do what > I want to do without modifying

[web2py] request.vars and lists question

2011-01-16 Thread rick
do differently to make that happen? Thank you, rick

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

[web2py] Re: request.vars and lists question

2011-01-16 Thread rick
Ah! Thank you, that works great. - rick On Jan 16, 3:10 pm, Jonathan Lundell wrote: > Try: theAnimals = request.vars.getlist("animals")

[web2py] Re: account for each user

2011-01-16 Thread Rick
thanks for the comments. I deleted the #. At the beginning of create.html there is this code: {{import datetime}} {{import uuid}} {{recording=datetime.date(2000,01,01)}} ...but the error remains :( On Jan 16, 2:13 pm, "Martin.Mulone" wrote: > in create.html > > #if recording!=record.thedate:} >

[web2py] Re: account for each user

2011-01-16 Thread Rick
Yes, {{=form}} works without the other code. On Jan 16, 6:35 pm, Martín Mulone wrote: > to test, put only  {{=form}} in create.html remove all the other. Now the > error continue? > > 2011/1/16 Rick > > > > > > > > > > > thanks for the c

[web2py] Re: account for each user

2011-01-16 Thread Rick
Perhaps the previous post was a bit vague. I meant that create.html works when it only contains {{=form}}. On Jan 16, 8:35 pm, Rick wrote: > Yes, {{=form}} works without the other code. > > On Jan 16, 6:35 pm, Martín Mulone wrote: > > > > > > > > > to test

[web2py] Re: account for each user

2011-01-16 Thread Rick
Hmmm... strange... the error disappeared, but it was replaced by another one: KeyError: 'thedate' ...and this error arises from the html-table in the create.html -- the code works when i delete the table. On Jan 16, 8:40 pm, Rick wrote: > Perhaps the previous post was a bit vague.

[web2py] Re: account for each user

2011-01-16 Thread Rick
I suppose that the problem is that the "records" list isn't completely returned from the controller file to create.html and that the "thedate" field is lost in that process. On Jan 16, 9:32 pm, Rick wrote: > Hmmm... strange... the error disappeared, but it w

[web2py] Re: account for each user

2011-01-17 Thread Rick
=db.day.thedate) ...The last version worked, but it doesn't fulfill the function I want it to have, namely to select records that are associated with the user that is logged in: records = db().select(db.day.ALL, orderby=db.day.thedate) Any ideas? >On Jan 16, 9:54 pm, Rick wrote: > I suppose that

[web2py] passing varibales

2011-01-22 Thread Rick
Hi, My problem is that I want to make a {{=A...}} tag that also changes the value of the variable session.variable, and I don't know how to do this. I tried with: {{=A(("[ < ]"), session.variable=-1, _href=URL('function'))}} ...but it didn't work.

[web2py] Re: passing varibales

2011-01-22 Thread Rick
/22/2011 02:53 PM, b0j3 wrote: > > > > > > > > > On 22 jan., 11:47, Rick  wrote: > >> Hi, > >> My problem is that I want to make a {{=A...}} tag that also changes > >> the value of the variable session.variable, and I don't know how to

[web2py] Re: passing varibales

2011-01-22 Thread Rick
bit cleaner. > BR, > JB > > On 01/23/2011 01:04 AM, Rick wrote: > > > > > > > > > Thanks for the replies. I wrote a special def for the operation: > > def minorvar(): > >    variable-=1 > >    redirect(URL('index')) > > ...bu

[web2py] Re: passing varibales

2011-01-22 Thread Rick
- > Best Regards, > Jason Brower > > On 01/23/2011 05:15 AM, Rick wrote: > > > > > > > > > Here is some code from the controller file: > > > > variable = 0 > > > def index() > >    some operations with the vari

[web2py] Overlapping periods

2012-04-13 Thread Rick
Hi, I try to make a function that puts periods of time into a database. The function should only add periods that doesn't overlap any of the already registered ones. But the function does not work, and I can't see what's wrong. Any idea? Thanks in advance for help! code from the controller

Re: [web2py] Overlapping periods

2012-04-15 Thread Rick
Thanks for the replies. Pbreit, you pointed the real issue -- what should I call the arguments (addperiodform.vars.id), that are passed from the goal function to the addingperiod function? from the controller file: def goal(): ...some code... addperiodform = SQLFORM(db.period, field

[web2py] date variables, json and jqplot

2011-10-08 Thread Rick
Hi, I want to draw a graph with jqplot, where the x-axis is a date- timeline, but I get this message: TypeError: datetime.date(2011, 10, 2) is not JSON serializable Does anyone know an easy way to pass date variable to json? Thanks in advance for help. Here is some code from the files: **

[web2py] Re: date variables, json and jqplot

2011-10-08 Thread Rick
--> On Oct 8, 7:09 pm, DenesL wrote: > try > > points=[[point.thedate.strftime('%Y%m%d'), point.value] for point in > pointlist] > > or some other format that suits your needs. > > On Oct 8, 10:29 am, Rick wrote: > > > > > > > >

[web2py] Submit gutton in fields

2011-12-01 Thread Rick
Hi, How to change the text on the submit button in fields? Here'sthe code: Field('thedate', 'date', label=T(''), widget=SQLFORM.widgets.date.widget)) I tried with this, but i didn't work: Field('thedate', 'date', label=T(''), submit=INPUT(_type='submit'('Some text')), widget=SQLFORM.widgets.date.

[web2py] Re: Submit gutton in fields

2011-12-01 Thread Rick
s, they are added as an input element to an > entire form. Where is that Field definition -- in a table definition or > SQLFORM.factory? Anyway, SQLFORM takes a 'submit_button' argument, which is > the text for the submit button. > > Anthony > > > > > > > >

[web2py] Re: Submit gutton in fields

2011-12-01 Thread Rick
RM.factory( Field('thedate', 'date', label=T(''), widget=SQLFORM.widgets.date.widget), submit_button='Some text') Thanks in advance for help On Dec 1, 10:37 pm, Rick wrote: > Thanks! This is the final code: > dayform = SQLFORM.factory(

[web2py] ttf and fonts

2011-12-02 Thread Rick
Hi, How to use a local font? I put a library with ttf-files inte the static/css directory and write this code in the css file: @font-face { font-style: normal; font-weight: normal font-family: "myfont"; src: url(ttf/DejaVuSans.ttf); } html, body { font:myfont} But it doesn't work.

[web2py] date and sum

2011-12-04 Thread Rick
Hi, I've a stack of records where records with the same date has different values, eg: record.date[0] = 2011-12-01 record.value[0] = 10 record.date[1] = 2011-12-01 record.value[1] = 20 record.date[3] = 2011-12-02 record.value[3] = 10 And now I want to summarize the values that are recorded for resp

[web2py] Re: date and sum

2011-12-04 Thread Rick
...).select(db.table.date,db.table.value.sum(),groupby=db.table.date) > for row in rows: print row.table.date, row(db.table.value.sum()) > > mind that 'date' and 'value' are not good field names. Will work with > sqlite but will break with other engines. > > On

[web2py] Re: date and sum

2011-12-05 Thread Rick
t() all by itself (not as a method of a Set object) -- doesn't that > raise an error (there's no function called 'select' in web2py)? The sum > should be applied in the initial query, not on the returned rows after the > query. > > Anthony > > > &

[web2py] avoid logging-in-site

2011-12-07 Thread Rick
Hi, >From my controller file: @auth.requires_login() def create(): ... def somethingelse(): ... When the user isn't logged in but tries to open the site "create.html", then he's redirected to the logging-in-site. My problem is that I'd like the user to be redirected to "somethingelse.ht

[web2py] possibly difficult database form

2011-02-14 Thread rick
I'd like to do something quite challenging (in my view) with web2py. I have a table (products), where each product has one or more codes. The list of possible codes are stored in a separate table (codes), and a third table (product_codes) stores the relationship(s) between the product and the code

[web2py] list and loop problem

2011-03-10 Thread Rick
Hi, I want to print a linked list and add a "delete this item" button next to each item: [item 1][delete this item] [item 2][delete this item] [item 3][delete this item] ...but I've no clue how to write the code. The problem is to direct the second delete button to the se

[web2py] Re: list and loop problem

2011-03-10 Thread Rick
I'd like to print the list in a html file. On Mar 10, 6:16 pm, Bruno Rocha wrote: > where do you want to output this? > > in to pure HTML or in a SQLTABLE? > > 2011/3/10 Rick > > > > > > > > > Hi, > > > I want to print a linked list a

[web2py] Re: list and loop problem

2011-03-10 Thread Rick
I meant that I'd like to print on a html _page_. On Mar 10, 6:34 pm, Rick wrote: > I'd like to print the list in a html file. > > On Mar 10, 6:16 pm, Bruno Rocha wrote: > > > > > > > > > where do you want to output this? > > > in to pure

[web2py] "settings site" membership_panel and AJAX

2014-03-04 Thread Rick
Hi, I'm trying to make a setting-site for the logged in user, but it doesn't work. I try to use the membership_panel, but desipte of searching, I haven't found any tutorial or similar about the panel. Thanks in advance for help! Here is the code: @auth.requires_login() def user_settings(): mem

[web2py] Re: "settings site" membership_panel and AJAX

2014-03-04 Thread Rick
Sorry for the thread. I read this link and thought that *membership_panel*was a part of web2py: http://www.web2pyslices.com/slice/show/1542/manage-users-and-memebership-in-the-same-form but now I've fixed the problem by studying *virtual fields*. -- Resources: - http://web2py.com - http://web2py

[web2py] Re: "settings site" membership_panel and AJAX

2014-03-04 Thread Rick
Thanks a lot! -- 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 "web2py-users" gr

[web2py] How to insert rows in a database from a html page in web2py?

2023-07-06 Thread Rick
How to insert rows from a view-file? The site doesn't produce any error, but an empty row is added to the database.: >From the model file db.define_table('next_list', Field('node'), Field('next_node')) >From the view file: {{nextrows = db(db.next_list)}} {{db.next_list.insert(**db.next_list._

Re: [web2py] How to insert rows in a database from a html page in web2py?

2023-07-06 Thread Rick
quot; , > "next_node":"test2" }))}} > > Il giorno gio 6 lug 2023 alle ore 13:47 Rick ha > scritto: > >> How to insert rows from a view-file? The site doesn't produce any error, >> but an empty row is added to the database.: >> >> From the mo

Re: [web2py] How to insert rows in a database from a html page in web2py?

2023-07-07 Thread Rick
ist._filter_fields({ "node" : "test1" , > "next_node":"test2" })) > > print(db(db.next_list).select()) > > next_list.id,next_list.node,next_list.next_node > > 1,test1,test2 > > 2,test1,test2 > > > > Il giorno gio 6 lug 20

Re: [web2py] How to insert rows in a database from a html page in web2py?

2023-07-08 Thread Rick
Thank you for pointing out that there was an issue with the database. After deleting the content of the database folder everything works. Tanks for the help! On Friday, 7 July 2023 at 16:16:06 UTC+2 Rick wrote: > Thanks Massimiliano for the answering quickly. The suggested code produ

[web2py] Call def with arguments from html view

2023-07-14 Thread Rick
How to call a def with request.vars arguments from an onclick-event in a view file? What is wrong with the code? Thanks in advance for help! Controller: def insnext(): nodename=request.vars['nodename'] nrowid=request.vars['nrowid'] db.next_list.update_or_insert(**db.next_list._fil

Re: [web2py] Re: Initiating table

2010-07-03 Thread Rick Hultgren
Yarko Tymciurak wrote: > The online book has a fairly useful search; > > For your question, see: > http://web2py.com/book/default/section/6/13 > > Regards, > - Yarko > > On Jul 3, 8:45 am, Rick wrote: >> Hi, >> >> I would like to link a table to it

Re: [web2py] Re: Initiating table

2010-07-04 Thread Rick Hultgren
) db.define_table( 'locus', Field( 'substance', db.substance), Field( 'process', db.process), Field( 'condition', db.condition), Field( 'locus', db.locus), Field( 'name'), Field( 'main_name')) On 7/4/10, mdipierro wrote: >

Re: [web2py] Re: Initiating table

2010-07-04 Thread Rick Hultgren
perhaps the table names will be changed, so please don't bother about "before" and "after"...the point is -- how to refer/link to the table name "locus", when that table is not yet created/declared/made? On 7/4/10, Rick Hultgren wrote: > Thanks for the answ

Re: [web2py] Re: Initiating table

2010-07-04 Thread Rick Hultgren
...with other words -- how to add fields to a table that is already declared? Is it possible? On 7/4/10, Rick Hultgren wrote: > perhaps the table names will be changed, so please don't bother about > "before" and "after"...the point is -- how to refer/link to the

Re: [web2py] Re: Initiating table

2010-07-06 Thread Rick Hultgren
(item) for item in letters] Thanks a lot for the help! On 7/4/10, mdipierro wrote: > No. > > Given db.define_table('sometable',*fields), you cannot add fields > outside this statement but you can call the statement in a separate > http request and add fields to the *fi

Re: [web2py] Re: Initiating table

2010-07-06 Thread Rick Hultgren
ooops... this should be the correct code: letters=['A', 'B', 'C'] fields=[] for letter in letters: db.define_table(letter, *fields) fields=[Field(item+'_id', db[item]) for item in letters] ...sorry for the bad code int the previous message. On 7/6

  1   2   >