I want to store images in the database and I'm having trouble with
my SQLFORM. I've copied the example from the manual but find that
the image doesn't go into the database on 'new'. I'm on web2py
Version 1.63.3
Apologies in advance if it's a typo.
1) With no argument (="insert" form) I get an ex
I was involved in the older thread and went ahead used the logging
module and haven't had any problems logging to file and to MySQL. I
did a bit more research and think it's thread safe. But I haven't had
many concurrent users so YMMV.
Chris
On Jun 9, 4:04 am, mdipierro wrote:
> I forgot. Thanks
> What if server
> is in East Kazakhstan and the user is in Hackensack, New Jersey? What
> time zone is request.now?)
If the server and user are in different time zones I don't believe
there's an easy solution, especially when you consider daylight saving
time (i.e. just converting everything to
It is better to store times as 'times' in the database rather than
muck about with times in string format. A lot better.
I think this controller model / code will do what you want (note that
I didn't make a 'weekday' table and I force the current seconds to
zero to you get results that start duri
> One way of disabling the time picker is to remove the line
> try { $("input.time").clockpick({ starthour:0, endhour:23,
> showminutes:true, military:true}); } catch(e) {};
> from web2py_ajax.html in 'views'. Another way would be do use jquery
> to remove the clockpick class from the input fi
> I have two more questions though:
>
> In the interface the time displays like 15:00:00 how do I get it do
> display in the format: 15:00?
Changing your widget to the following will change the way the time
appears in forms:
def timeplain(field,value):
if value == None:
value
> Changing your widget to the following will change the way the time
> appears in forms:
Apologies, my formatting of the code made it unreadable. Reposting the
modified widget that formats the time without seconds:
def timeplain(field,value):
if value == None:
value = ''
> In my model I also have a widget which reads like:
>
> db.event.plaats.widget=lambda self,value:INPUT
> (_type='text',_id='place',_class='ac_input',_name='plaats',value=str
> (value),requires=self.requires)
>
> The widget Chris provided me with reads like:
>
> def timeplain(field,value):
> i
> In my case, I would create a widgets.py file in the modules folder of
> my application, put the widget code in widgets.py, in my model import
> the widgets (from modules import widgets) and use it like this:
> widget=timeplain. Wouldn't I?
Very nearly! Since your web site is running as part of w
If you're still having problems with this then please post the error
message you receive and the relevant parts of the actual code. Whilst
I and others are keen to help I'm afraid I don't have time to trace
through everything above, and I don't understand the ??? parts. Warm
regards, Chris.
--~--~
Session data is normally stored on disk in the "sessions" folder in
python pickle format - only the session id is transferred over the
network connection between the client and the server. (I say
"normally" because there is also an option to store session data in
the database, though this has to b
I've had success with PIL to thumbnail uploaded images.
In upload form handling:
if form.accepts(request.vars,session):
if not form.vars.get("delete_this_record",False):
response.flash = "image accepted"
makeThumbnail(form.vars.id)
else:
response.flash =
I wanted to have a field on an SQLFORM that behaved like IS_IN_DB
(i.e. a drop box with values shown to the user and a corresponding id
inserted into the database).
I didn't want to take the source data from the database though because
it is more program data than user data and I wanted to use
in
Ah, thought there must be an existing way of doing it but I didn't
realise you could use 'labels=' with IS_IN_SET :-)
On Nov 26, 1:59 am, DenesL <[EMAIL PROTECTED]> wrote:
> cj, wouldn't that be equivalent to:
>
> db.table.myField.requires=IS_IN_SET([0,1,2],labels=[T('Alpha'), T
> ('Beta'),T('Gam
For an index I guess Joe means a hyperlinked index / table of contents
where you can click on an entry to go to the page. This would need to
be generated by re-PDFing the original document I guess.
I made the document easier to view in the small window of my eee pc by
using printing the PDF I dow
If I have a controller file as below I find that the decorator()
function is called when any controller in the file is called not just
the decorated ones. i.e. If I access /application/default/index I see
"decorator called" as well as when I access /application/default/
index2. Am I doing somethin
Thank you, Yarko, i've seen examples like your most recent before but
now I think I finally get it. Do you think this is a good way of doing
validation-if the validation fails a controller indicating an error is
returned instead of self.f()?
--~--~-~--~~~---~--~~
Yo
Depending on the size of the input string, urlsafe_b64encode() padds
the resulting string with '=' characters.
If the generated string is used as a URL argument e.g.
http://localhost:8000/default/app/controller/function/DxFOVxWvvzGdOSh2ARkK-2XPXNavnpiCkD6RuKLffvA=
Then I appear to get an "inval
Hi Mick
I'm far from being an expert but I'll try and be helpful..
web2py follows the Model-View-Controller arrangement for web
applications. This approach is now common in many web frameworks
because it allows you to separate different aspects of the
application. In a large project they might b
I have a page that contains mainly text information in the view
arranged in sections with labels. I've not put it
in 'static' because I want to use views/layout.html.
How can I link from another page to a particular section? I've tried
putting '#secname' at the end of the f= parameter in {{=URL(
On Feb 12, 1:25 pm, Kacper Krupa wrote:
> {{= URL(r=request, c='controller', f='function', args='#arg') }}
> or
> {{= URL(r=request, c='controller', f='function', args=['#arg']) }}
>
> ?
>
No, that gives an '
Massimo
>
> On Feb 12, 9:10 am, mdipierro wrote:
>
>
>
> > sorry I misunderstood the question. perhaps URL should have an achor
> > argument keyword.
>
> > Massimo
>
> > On Feb 12, 9:02 am, Kacper Krupa wrote:
>
> > > The only way what i
I'd like a bit more understanding about how web2py handles cookies and
the 'session' variable. When a user logs in I want to offer the option
of keeping their log in on this computer (if not using a public
computer).
My mechanism at the moment is to store information in the session
including an e
Thank you, as ever, Massimo, for your devotion and advice!
> The lack of client-size expiration which is an
> attribute of the cookie itself, is the reason why they are not
> persistent. This can be easily changed.
This was my point of my not-understanding about the expiry.
The use of the HMAC
On Feb 19, 1:32 pm, mdipierro wrote:
> To set the expiration for the session cookie and thus making it
> persistent just do:
>
> response.cookies[response.session_id_name]['expires']="Fri, 3 Aug
> 2009 20:47:11 UTC"
For some reason I'm doing this wrong. If I log the contents of
'response' I
you want to expire a session server side you need to do
> it via a session variable. Settings "expires" in the cookie should
> indicate your browser that the browser should not send back to the
> server this cookie after the expire time. I am not sure how browsers
> really h
1. One way is to use the routes.py script in the web2py directory to
rewrite URLs, assuming you are using web2py's built in web server.
There are instructions in the script. Ask here again if you're not
sure
2. All functions are exposed in controllers except:
- any function that takes an argument
Very keen to see centralised (well organised)documentation, and to
help where I'm able.
I think it's better to use an established Wiki/code framework. It
would be nice to have a solid feature-full wiki in web2py. Less time
developing / maintaining a web2py-wiki means more time enhancing and
docum
If you agree it would be good to think about structure before we start
(e.g even http://mdp.cti.depaul.edu/examples/default/docs is a bit
overwhelming) I made a "documentation organisation" page on the test
wiki. Please edit/delete what I put there already and / or comment.
https://mdp.cti.depaul
> Use the wiki for the initial gathering of doc pages, then after the
> first sphinx-based documentation is produced, just clean the wiki of
> those pages. After that, just use the wiki for contributed recipes
> and other pages, some of which are selectively migrated to sphinx.
> Keep the change
I made a change to one of my models to increase
the size of a VARCHAR field from 64 to 138. I'm
using MySQL 5.0.51a-3ubuntu5.4 and web2py 1.57. I
had the same problem with web2py 1.55.
The SQL shown in sql.log is:
timestamp: 2009-03-04T08:24:03.934903
ALTER TABLE meetups ADD entry_key__tmp VARCH
> First, drop the row.
> Second, add the row again with the new size
Yes, this resulted in a migrated table with
the new field having the correct size and
no errors. (obviously I lost the data in the
field).
I can't see how the migrate commands written
in sql.log are different from when I hand-
A lot of free documentation is available, including example code in
the posts on this mailing list.
The web2py book is very reasonably priced, especially in PDF form. As
I understand it, the documentation is in the form of a proper
publication because Massimo has developed web2py in the context o
I have renamed web2py.py to web2py.pyw and then start web2py using a
shortcut with target set to
\web2py.pyw -t
You need to have .pyw appropriately set up as a file type in windows
explorer for this to work I think. I had installed a windows
distribution of Python before I had web2py, and I the in
It's evil and horrific but if you're desperate you could maybe at the
start of the function store the arguments in the session then redirect
to the same function, without the arguments in the URL. At the start
of the function, check for the details in the session, store them in a
local variable a
"logging in" or as in "logging module"?
>
> On Oct 15, 4:31 am, cjparsons <[EMAIL PROTECTED]> wrote:
>
>
>
> > Are there any clever ways for debug logging? I am planning to use the
> > Python logger module to a file in the administration direct
Are there any clever ways for debug logging? I am planning to use the
Python logger module to a file in the administration directory which I
guess will only be visible if logged in?
Thanks for any ideas you have
Chris
--~--~-~--~~~---~--~~
You received this messa
I have some helper functions in applications/[application]/modules/
helperFunctions.py.
I import that in my controller using the full path applications/
[application]/modules/helperFunctions
I find that if I make changes to helperFunctions.py web2py doesn't see
them until I restart web2py. Is th
38 matches
Mail list logo