[web2py] Re: SQLFORM.factory does not create the table in db, so how to query results?

2011-10-11 Thread dlypka
Thanks - your reply helped me see how it works. I did not realize that web2py just puts the name of *only* the selected radio button in request.vars. I had been looking for all 3 of my radio buttons, assuming there would be a checked=true attribute on one of them. But instead, just the presence of

[web2py] Re: Help! import winrandom gives dll load failed error under Apache on Vista, but works under Rocket.

2011-10-11 Thread dlypka
P.S. In this scenario, you have to run web2py with -i 138.85.50.99 -p 8000 for example: python web2py.py -a "" -i 138.85.50.99 -p 8000 On Oct 10, 6:36 pm, dlypka wrote: > Resolved: > > After researching, I see this problem plagues many other developers as > well. > The root cause is

Re: [web2py] Re: Help for creating template

2011-10-11 Thread Miroslav Gojic
I have login form (I can regiser, or log in, ...) but how to apply this login to some site page. from login.form I can get user.name or user.id I need something like if to check this {{ if user.name == 'user':}} go to some page or some content {{else:}} open login form {{pass}} this is what is

[web2py] Re: db events trigger

2011-10-11 Thread guruyaya
On Oct 12, 4:18 am, Massimo Di Pierro wrote: > As I said, the problem is not the names or when they should be called. > The problem is. What should be input and the output of each of these > functions? Whenever I'm in a problem with a full stack web framework, I think to myself "what would cake

[web2py] Re: DAL level access to GAE entities by named key

2011-10-11 Thread Wikus van de Merwe
I'm getting nothing (None). If the intention was to having it work this way (by passing key as id) I'll have a look at the DAL code more closely. Maybe something affects the key outside of the select_raw function. Have this ever worked for you?

[web2py] Re: db events trigger

2011-10-11 Thread guruyaya
Don't forget on table creation and alteration. On Oct 11, 11:57 pm, Bruno Rocha wrote: > Would be nice to have some global events in web2py workflow. I can imagine > some useful hooks: > > workflow global events: > > onrequest # before the execution of action/model > > prerender # after the execu

[web2py] Python 2.7 on GAE (experimental)

2011-10-11 Thread pbreit
http://code.google.com/appengine/docs/python/python27/newin27.html

[web2py] Re: db events trigger

2011-10-11 Thread Massimo Di Pierro
As I said, the problem is not the names or when they should be called. The problem is. What should be input and the output of each of these functions? On Oct 11, 9:03 pm, Vinicius Assef wrote: > I suggested it 2 years ago. I'll be happy if it come true someday, in web2py. > > I see it as database

Re: [web2py] Storing date format in dd-mm-yyyy in database

2011-10-11 Thread Vinicius Assef
Clarifying, date fields are stored in internal format and they are optimized for that. You can customize representation format, not stored format. It was what Ovidio showed you. -- Vinicius Assef. On Tue, Oct 11, 2011 at 10:16 PM, Ovidio Marinho wrote: > >       in db >     Field('start_time',

Re: [web2py] Re: db events trigger

2011-10-11 Thread Vinicius Assef
I suggested it 2 years ago. I'll be happy if it come true someday, in web2py. I see it as database triggers: before_ & after_. I.e: before_insert, after_insert. Event can be: insert, update, delete, query. "before_insert" receives values that will be inserted on database. It is the last chance to

[web2py] Re: table without id

2011-10-11 Thread tomt
Hi, I have been able to access legacy databases that don't have an id field. In the following example 'pointnumber' is the primary key, and is unique. I was able to read values from this table with DAL. I used the following model: db2.define_table('statuspoint', Field('pointnumber','integ

Re: [web2py] Storing date format in dd-mm-yyyy in database

2011-10-11 Thread Ovidio Marinho
in db Field('start_time','datetime',requires=IS_DATETIME(str(T('%Y-%m-%d %H:%M:%S', Field('stop_time','datetime',requires=IS_DATETIME(str(T('%Y-%m-%d %H:%M:%S', db.task.start_time.represent = lambda v: v.strftime('%d/%m/%Y') db.task.stop_time.represent = lambda v: v.s

[web2py] Storing date format in dd-mm-yyyy in database

2011-10-11 Thread Rohit
I am developing an online booking application where I am storing the date using the date type of web2py which stores the date in -mm-dd format. I need to store the data in dd-mm- format in the datastore. For this I tried to use this : date.requires = IS_DATE(format=T('%d-%m-%Y') Tho

Re: [web2py] Re: db events trigger

2011-10-11 Thread Bruno Rocha
may be a dictionary of tablename_event:function I see that in DAL level this is very complicated. but what about the resquest-response workflow events. I had cases where I needed some global function to trigger before/after the template rendering and final response. http://zerp.ly/rochacbruno E

[web2py] Re: db events trigger

2011-10-11 Thread Massimo Di Pierro
the problem with this is not the names. ;-) Consider the case of preupdate and onupdate. db(db.person.age>18).update(can_drink=True) What information should be passed to preupdate and update? tablename? query? {'can_drink':True}? Number of affected records? Should there be one onselect per ta

Re: [web2py] Re: Book source repo

2011-10-11 Thread Justin Heath
Okay, thanks. On Oct 11, 2011 4:24 PM, "Massimo Di Pierro" wrote: > No. the only book is a wiki but it is temporary locked because I am > doing some work on it. > > On Oct 11, 12:57 pm, jheath wrote: > > Is there a repo where I can check out the current web2py book source? > > I'd like to be abl

[web2py] Re: migration fails when modifying field with notnull=True

2011-10-11 Thread Alex
I think this has to do with the web2py migration code. Maybe it only happens if the db is PostgreSQL. Now that I know that a default value should hopefully solve this its not an issue for me anymore. But I think it should not be necessary in first place, or if it is, it would be good if it would be

[web2py] Re: on grid and smartgrid search feature

2011-10-11 Thread Stefaan Himpe
Massimo Di Pierro wrote: The new grid/smartgrid have a much better search feature. A new button query shows a popup panel that allows you to build the query string. Can you please check on your existing tables and see if you encounter any problems? The capabilities columns seems to be missing

Re: [web2py] Re: db events trigger

2011-10-11 Thread Michele Comitini
I like the idea! +1 It is common in many frameworks. IMHO seems more common on compiled languages frameworks for some reason. mic 2011/10/11 Bruno Rocha : > Would be nice to have some global events in web2py workflow. I can imagine > some useful hooks: > > workflow global events: > > onrequest #

[web2py] Re: manual file upload using SQLFORM.factory

2011-10-11 Thread Alex
the files in the uploads folder should be save since they are all renamed. But what happens if the user passes e.g. '../models/db.py' as parameter? (the slashes would have to be encoded though, is this possible?) Then he would get access to the data model which would not be good at all. I'm now tes

Re: [web2py] Re: Making slides with web2py and markmin

2011-10-11 Thread Bruno Rocha
you are putting it in modules while it has to be in models. if you want it in modules you will need to explicitely import all web2py helpers and context. from gluon import * http://zerp.ly/rochacbruno Em 11/10/2011 16:28, "jotbe" escreveu: > Thanks for the module, Massimo! > > Unfortunately, i

Re: [web2py] Re: db events trigger

2011-10-11 Thread Bruno Rocha
Would be nice to have some global events in web2py workflow. I can imagine some useful hooks: workflow global events: onrequest # before the execution of action/model prerender # after the execution of action/model but before the view rendering onrender # after the view render but before the ou

[web2py] Re: DAL level access to GAE entities by named key

2011-10-11 Thread howesc
i am under the belief that while undocumented it should work and most likely can be fixed. are you getting an error, or just nothing in the result?

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread Massimo Di Pierro
If an ajax grid does work please open an issue on google code so I can check it and we can fix it. I cannot reproduce your problem otherwise. On Oct 11, 1:12 pm, apple wrote: > Surely there must be a solution to this? It does not seem logical to > have a component that is arbitrarily restricted

[web2py] Re: Book source repo

2011-10-11 Thread Massimo Di Pierro
No. the only book is a wiki but it is temporary locked because I am doing some work on it. On Oct 11, 12:57 pm, jheath wrote: > Is there a repo where I can check out the current web2py book source? > I'd like to be able to make corrections as I read through the book and > submit a patch file, ins

[web2py] Re: db events trigger

2011-10-11 Thread Massimo Di Pierro
Not yet at the db level but at the form level: form=SQLFORM(...).process(onsuccess=lambda form:...) On Oct 11, 3:11 am, Manuele wrote: > Hi, > is there a way to trigger some functions on database eventes, for > example on new record? > > thanks a lot > >      Manuele

[web2py] Re: Making slides with web2py and markmin

2011-10-11 Thread jotbe
Thanks for the module, Massimo! Unfortunately, it is not working in a test app: ## snip ## $ python web2py.py -P -M -S slides web2py Web Framework Created by Massimo Di Pierro, Copyright 2007-2011 Version 1.99.3 (2011-09-26 10:32:57) dev Database drivers available: SQLite3, pymysql Python 2.7.2 (

Re: [web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread Richard Vézina
I was really disappointed about Datatables not managing correctly more then one instance of table in the same page... Problem with Datatables, is that it not supports the export button to work on more then once instance of datatables init per page if you choose to put your tables into tabs with jQu

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread apple
also slightly frustrating is that the add/view/edit pass the table name so you can generate output based on that. However the paginate buttons do not pass the table name. So if you have a controller that dynamically creates grid parameters depending on the table then this does not work with pag

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread apple
Surely there must be a solution to this? It does not seem logical to have a component that is arbitrarily restricted to one per page? iframe is not a good solution. And I don't think LOAD with ajax works with multiple grids and pagination - certainly it does not work in my application even after t

[web2py] Book source repo

2011-10-11 Thread jheath
Is there a repo where I can check out the current web2py book source? I'd like to be able to make corrections as I read through the book and submit a patch file, instead of opening a bunch of bug reports.

Re: [web2py] Re: checkbox input default value

2011-10-11 Thread Wikus van de Merwe
Try to define default values for your fields: name = Field("name", "boolean", default=False)

Re: [web2py] Re: new feature - need help

2011-10-11 Thread Paolo Caruccio
Richard, thank you.

[web2py] Re: OnClick with SELECT

2011-10-11 Thread juanduke
Hi Richard: I think you need fire the onchange event, in the select tag ( whit _onchange="yourJSFunction();" if using SELECT helper) May be you can see this slice ( http://www.web2pyslices.com/slices/take_slice/144) and the working sample app: http://ochiba.fluxflex.com/Ajax_Cascading_Drop_Down/

[web2py] OnClick with SELECT

2011-10-11 Thread horridohobbyist
I'm trying to do something fairly simple. I have a dropdown list of product names from a product database. When the user clicks on the dropdown list and chooses a different product name, I want a function to execute "onclick" that goes to the product database, retrieves the rest of the record, and

[web2py] Re: serving binary data

2011-10-11 Thread Matt Broadstone
Whoops, I just needed to refer to the direct binary data, it was passing an object in. On Tue, Oct 11, 2011 at 12:11 PM, Matt Broadstone wrote: > Greetings, >   I am trying to serve binary image data from one of my controllers. > The data comes in via xmlrpc, and as such I have access to an xml

Re: [web2py] Re: new feature - need help

2011-10-11 Thread Richard Vézina
Nice implementation Paolo! On Mon, Oct 10, 2011 at 9:56 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Done. Thank you! > > > On Oct 10, 6:11 pm, Paolo Caruccio wrote: > > The result is splendid with your changes. > > I want only suggest to replace the row # 1344 in /gluon/sqlhtml.

[web2py] serving binary data

2011-10-11 Thread Matt Broadstone
Greetings, I am trying to serve binary image data from one of my controllers. The data comes in via xmlrpc, and as such I have access to an xmlrpc Binary object of the image data. I've written a controller that tries to emulate what response.download does, but it doesn't seem to work. Can anyone

[web2py] Re: table without id

2011-10-11 Thread Anthony
See http://web2py.com/book/default/chapter/06#Legacy-Databases-and-Keyed-Tables.

[web2py] Re: re populate

2011-10-11 Thread Anthony
On Tuesday, October 11, 2011 10:49:59 AM UTC-4, apple wrote: > > Have just started using "populate" which is a really useful tool. > However I have a couple of questions: > > 1) It seems to ignore the length specified for string fields. For > example it fills my postcode field with 100 character

[web2py] Re: Static forms

2011-10-11 Thread Anthony
I think you need to use the radio widget in conjunction with the IS_IN_SET or IS_IN_DB validator (it creates the radio button options from the labels/values specified in those validators). Anthony On Tuesday, October 11, 2011 10:45:38 AM UTC-4, Web2Py Freak wrote: > > am trying to use SQLFORM.f

[web2py] table without id

2011-10-11 Thread Cory Coager
I have created some database tables externally to web2py. Does web2py require an id field for tables? The reason why I'm asking is, when I use the DAL to do an insert, web2py tries to retrieve the currval of the insert. Seeing how I don't have an id, this throws an exception. How should I handle

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
oh thnx richard its working , and its a radio now but tell me how can i get its valu when accepted ??

[web2py] re populate

2011-10-11 Thread apple
Have just started using "populate" which is a really useful tool. However I have a couple of questions: 1) It seems to ignore the length specified for string fields. For example it fills my postcode field with 100 characters of text despite it having length of 8. Is there a way of restricting the

Re: [web2py] Re: Static forms

2011-10-11 Thread Richard Vézina
Maybe you need a boolean to use this widget?! Richard On Tue, Oct 11, 2011 at 10:45 AM, Web2Py Freak wrote: > am trying to use SQLFORM.factory with a widget but its not working : > > def booking(): >content=db(db.page.title=='booking').select(db.page.ALL) >form = SQLFORM.factory( >

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
am trying to use SQLFORM.factory with a widget but its not working : def booking(): content=db(db.page.title=='booking').select(db.page.ALL) form = SQLFORM.factory( Field('your_name', requires=IS_NOT_EMPTY()), Field('your_email'), Field('like',widget=SQLFORM.widgets

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread Anthony
On Tuesday, October 11, 2011 9:49:51 AM UTC-4, stefaan wrote: > > (workaround: e.g. use iframes, or design a better UI that doesn't need > two grids in one view ;) > Using ajax components might be better/easier than iframes.

[web2py] on grid and smartgrid search feature

2011-10-11 Thread Massimo Di Pierro
The new grid/smartgrid have a much better search feature. A new button query shows a popup panel that allows you to build the query string. Can you please check on your existing tables and see if you encounter any problems? You will need trunk but also the latest applications/welcome/js/ web2py_aj

[web2py] Re: Making slides with web2py and markmin

2011-10-11 Thread Massimo Di Pierro
I do not understand the bug. Can you provide an example? On Oct 11, 5:28 am, peter wrote: > Using windows, and web2py version 1.99.2, if I setup a simple > applicatioin, add slides.py and the test as per your instructions: > > Things only half work. The link does not work, it says > > "you can us

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread Massimo Di Pierro
Let me explain and clarify. A grid can display multiple actions (select/edit/view/update etc...) it discriminates this from the URL. Different grid actions have different URLs. This is a feature. This allows you to reference a particular page in a grid using the URL and send for example a link to

[web2py] Re: two SQLFORM.grid in one view?

2011-10-11 Thread stefaan
Maybe useful for readers in the future: Using multiple grids in one view is not supported, and the problems won't be fixed. (workaround: e.g. use iframes, or design a better UI that doesn't need two grids in one view ;) )

[web2py] Re: Static forms

2011-10-11 Thread Anthony
You can use SQLFORM.factory if you don't have a db table. For a radio button, I suppose you could specify the radio widget for a given field (see http://web2py.com/book/default/chapter/07#Widgets), or you could build the HTML manually (review the details at http://web2py.com/book/default/chapte

[web2py] Re: Postgresql-problem when deleting fields

2011-10-11 Thread Johann Spies
On 11 October 2011 12:31, Johann Spies wrote: > I have changed the model of a populated table (removing two fields with > uuid-type references to other tables). > > Now when I restart web2py the process never becomes ready. In the > Postgresql-log I see: > > 2011-10-11 12:24:13 SAST LOG: could

Re: [web2py] Re: Database constraints or Web2py validators

2011-10-11 Thread Johann Spies
On 11 October 2011 13:48, Bruno Rocha wrote: > Note that you can use db.table.validate_and_insert and > db.table.validate_and_update to fire validators in pure DAL without forms. > > Thanks! I did not know about that. Regards Johann -- May grace and peace be yours in abundance through the fu

Re: [web2py] Re: Database constraints or Web2py validators

2011-10-11 Thread Bruno Rocha
On Tue, Oct 11, 2011 at 8:43 AM, Johann Spies wrote: > Thanks Anthony. I will probably make use of what you suggested. I did not > know how to involve the two fields in the form-evaluation. This will not > replace the database constraint: tackling this from both the backend and > the user inte

Re: [web2py] Re: Database constraints or Web2py validators

2011-10-11 Thread Johann Spies
On 11 October 2011 13:25, Anthony wrote: > Again, if just focused on form validation, I suppose another option would > be to use an onvalidation function (processed after form validation but > before db insert). > > Anthony > > > On Tuesday, October 11, 2011 7:23:33 AM UTC-4, Anthony wrote: >> >>

[web2py] Re: Database constraints or Web2py validators

2011-10-11 Thread Anthony
Again, if just focused on form validation, I suppose another option would be to use an onvalidation function (processed after form validation but before db insert). Anthony On Tuesday, October 11, 2011 7:23:33 AM UTC-4, Anthony wrote: > > On Tuesday, October 11, 2011 4:04:41 AM UTC-4, spyker wr

[web2py] Re: Static forms

2011-10-11 Thread Web2Py Freak
when using sqlform-in-html ,do i have to use a table in the db ,, and how can i create a radio button from there ?

[web2py] Re: Database constraints or Web2py validators

2011-10-11 Thread Anthony
On Tuesday, October 11, 2011 4:04:41 AM UTC-4, spyker wrote: > > I have several tables where there should only be one possible combination > of two uuid-fields per table (mostly many to many links). > > I have created 'unique' constraints for those fields in Postgresql so the > database would not

[web2py] Re: Static forms

2011-10-11 Thread Anthony
Same as usual -- you have to create a FORM (or SQLFORM) object in the controller and use form.accepts (or the newer form.process). You can create the form manually in HTML and just make sure you include the _formname hidden field (see http://web2py.com/book/default/chapter/07#SQLFORM-in-HTML),

[web2py] Re: Tag handling suggestions

2011-10-11 Thread stefaan
How does choosing option 1 <--> option 3 affect building a UI ? It seems to me that option 1 can be used "as-is" in an SQLFORM.grid containing other fields, whereas option 3 might require a separate SQLFORM.grid to manage the correspondence tags<->items? If this is just me not understanding all p

[web2py] Static forms

2011-10-11 Thread Web2Py Freak
Dear All , i want to build a form in html and when the form is accepted send its content in a Email , i know how to email it but i want to know how can i catch it in the controler and see if its accepted , how can i do that ??

[web2py] Postgresql-problem when deleting fields

2011-10-11 Thread Johann Spies
I have changed the model of a populated table (removing two fields with uuid-type references to other tables). Now when I restart web2py the process never becomes ready. In the Postgresql-log I see: 2011-10-11 12:24:13 SAST LOG: could not receive data from client: Connection reset by peer 2011-

Re: [web2py] Re: Tag handling suggestions

2011-10-11 Thread Martín Mulone
In my opinion I'll discard option number 1 if you are not running on GAE. Because is not a true SQL, is quite awfull indeed, bring it by nosql gae. But it's all depends on the amount of records. 2011/10/10 Bruno Rocha > I like this, and it is really smarter than list:string option, but, imagine

[web2py] Re: Making slides with web2py and markmin

2011-10-11 Thread peter
Using windows, and web2py version 1.99.2, if I setup a simple applicatioin, add slides.py and the test as per your instructions: Things only half work. The link does not work, it says "you can use http://www.google.com]] " "you can use images [[image" align="center" /> " If one tries emboldeni

[web2py] db events trigger

2011-10-11 Thread Manuele
Hi, is there a way to trigger some functions on database eventes, for example on new record? thanks a lot Manuele

[web2py] Database constraints or Web2py validators

2011-10-11 Thread Johann Spies
I have several tables where there should only be one possible combination of two uuid-fields per table (mostly many to many links). I have created 'unique' constraints for those fields in Postgresql so the database would not accept any inserts or edits which violates that constraint. I use that i