[web2py:23605] Re: How to control width of field displayed by SQLFORM?

2009-06-08 Thread Iceberg
On Jun8, 6:39am, DenesL wrote: > You can use CSS to change the width. > The default for your app is static/base.css, look at line 105. > You can also use JS/jQuery to alter the styling. Or do it inside model.py if you prefer: db.Field('aLongLongField','string',length=512, widget=lambda field,

[web2py:23726] Re: check out my newly built web2py app if you want

2009-06-09 Thread Iceberg
I promise Matt is surely right about the font issue. :-) And one more defect, trying to not completing necessary field results in a "function error_message at 0x8c1c41c" appearing at the usual response.flash area. Everything else seems ok. I like your two level menu especially. Hope to see your

[web2py:23743] Re: global logging to file

2009-06-09 Thread Iceberg
request.log(message) would be nice, but all the advantages of standard logging are too good to let go. So I came up with this little trick. Add following codes inside model/log.py: def _init_log(): import logging logger=logging.getLogger(request.application) logger.setLevel(logging

[web2py:23750] Re: web2py perfomance

2009-06-09 Thread Iceberg
> > > Any particular reason not doing is_integer via a 'try: int(i) except: > > return False'  statement ? It should be faster than regexes. > > > On Jun 7, 1:49 pm, Iceberg wrote: > > > > On Jun7, 6:35pm, Alexey Nezhdanov wrote: > > > > &g

[web2py:23759] Re: global logging to file

2009-06-09 Thread Iceberg
me so that it resides > inside the applicaitons folder: > > handler=logging.FileHandler(os.path.join(request.folder,"system.log")) > > we could also add a line in the admin to peek the log (like with > sql.log). > > On Jun 9, 12:18 pm, Iceberg wrote: > &

[web2py:23762] Re: global logging to file

2009-06-09 Thread Iceberg
your disk, hence it is not good for production site, unless you use RotatingFileHandler instead. 2. On GAE, you can not write to disk anyway, unless you use SMTPHandler or HTTPHandler etc. You get the idea. //shrug On Jun10, 2:45am, Iceberg wrote: > I am glad you like it. So every new app w

[web2py:23834] Re: global logging to file

2009-06-10 Thread Iceberg
return {'':TABLE(*[TR(item) for item in cache.ram('log_in_cache',lambda:None,time_expire=)])} On Jun10, 5:52pm, Hans wrote: > WOW Iceberg! That should also work well for me. Thanks for sharing > your solution idea! I'm going to try it later today. > A

[web2py:23880] Re: global logging to file

2009-06-11 Thread Iceberg
need to) log definition. As to the "OPTIONAL in controller" part, you can ignore it. They are just a rough demo and not necessary. On Jun11, 3:17am, mdipierro wrote: > Why do you need to cache the logging module? Is this only for speed? > > On Jun 10, 1:44 pm, Iceberg wrote: &

[web2py:24038] Re: universal data representation/encoding

2009-06-12 Thread Iceberg
No need to u'Castro de Avelãs', just 'Castro de Avelãs', providing that your source code itself is in utf8 (by default, it is). On Jun13, 7:27am, blackthorne wrote: > I'm trying to display text in a page using an universal encoding such > as UTF-8. > Here is an example: > return dict(message=u'C

[web2py:24040] Re: universal data representation/encoding

2009-06-12 Thread Iceberg
p with > message='Castro de Avelãs'. Something like, 'Castro de Avel?s' > > with message=u'Castro de Avelãs' I get 'Castro de Avels' > > On Jun 13, 3:26 am, Iceberg wrote: > > > No need to u'Castro de Avelãs', just 'Castro

[web2py:24043] Re: universal data representation/encoding

2009-06-12 Thread Iceberg
Me too. :-) After all, I've been done that manually for years. Should propose that much earlier. On Jun13, 10:44am, Francisco Gama wrote: > Massimo, I would suggest this correction by Iceberg as default for > controller and model templates... > > On Jun 13, 3:38 am, Iceberg

[web2py:24133] Re: upgrading app

2009-06-14 Thread Iceberg
On Jun14, 7:28pm, DenesL wrote: > I see. > But is this so because I am on the bleeding edge? > I mean, I hope this will not be the standard operating procedure for > the stable release. Not exactly. Those views/generic.* should be available by default if you create your app inside a recent web2p

[web2py:24337] Re: universal data representation/encoding

2009-06-16 Thread Iceberg
On Jun17, 12:16pm, Francisco Gama wrote: > ok, this one is solved but there is a situation where things still put > me away. > it's when I use T() in views with strings that contain special > characters like ç, á, à... > > e.g.: {{=T('A pé em Bragança')}} > This would fail the same way on the spe

[web2py:24393] Re: universal data representation/encoding

2009-06-17 Thread Iceberg
17, 7:38pm, Francisco Gama wrote: > That is not a solution. Personal Names have no language as well as > city names like the one in the example: "Bragança". > So T() should allow UTF-8. > > Massimo, how? > > On Jun 17, 7:18 am, Iceberg wrote: > > > > > O

[web2py:24412] Re: web2py 1.64.2 is OUT

2009-06-18 Thread Iceberg
Interesting. I fully understand and like the backward-compatible policy of web2py. But in this case, in this moment, I assume there aren't many people download 1.64.2 yet, and only Mr. Freeze is using the IS_COMPLEX. So, it is not too late now to change it to a more proper name. Otherwise, I thin

[web2py:25386] Re: confusion about web2py's MVC namespace

2009-06-30 Thread Iceberg
On Jul1, 12:08pm, Xie wrote: > Recently I'm having some trouble with web2py but I don't know where > the problem is. My best guess is that it's about the MVC namespace. > Please correct me if I'm wrong. > > The problem is that I defined a class "App" in models/utils.py and > when I tried to inher

[web2py:27300] Re: Minimal Application

2009-07-23 Thread Iceberg
Even I have been be with web2py for more than 18 months, I still feel somewhat difficult to catch up with the web2py evolution. So you are not alone, Mr. BG. :-) After all, it is good that web2py grows up fast. :-) And yes I also like the idea of providing a fancy scaffolding app and a minimal o

[web2py:27402] Re: Beijing University anybody?

2009-07-25 Thread Iceberg
To Yarko: By default the Lakeview Hotel homepage is already shown in Chinese. The button you mentioned is Japanese. But anyway what is the point? If your purpose is to meet somebody in the hotel who is in charge of the IT department, perhaps you can just ring to front desk and ask. Even so I doubt

[web2py:27969] Re: Fwd: My thoughts on web2py

2009-08-04 Thread Iceberg
me, for example, the datetime.utcnow issue can be easily addressed by a request.utcnow, and keep request.now as is but obsolete. Oops, problem solved without breaking backward compatibility. Regards, Iceberg On Aug5, 1:55am, Alex Fanjul wrote: > Massimo, > Many times I have seen that, due to back

[web2py:28535] Re: logo

2009-08-13 Thread Iceberg
I prefer A too. Because the "W" is unique enough to be recognized. On the contrary, the globe itself can not remind people about web2py. On Aug14, 12:29am, Massimo Di Pierro wrote: > Two logos have been proposed for web2py. I love them both and I would > like your opinions. Here they are attac

[web2py:28748] Re: {{=T('Howto')}}

2009-08-16 Thread Iceberg
Your answer might work, but I would suggest B(T('Howto')). The point is to separate language string (the "Howto") from appearance (the "..."). On Aug15, 7:34pm, hcvst wrote: > Is it > {{=XML(T('Howto'))}} > One tends to find an answer only ever after submitting a question. > > On 15 Aug., 13:22,

[web2py:28749] Re: New Book Chapters 7 (crud),8 (auth), 9 (services)

2009-08-16 Thread Iceberg
oller]/create_tablename Same typo applies to the next "update" example on the same page. Regards, Iceberg On Aug16, 3:53pm, Massimo Di Pierro wrote: > Here is the latest draft of the new chapters added to the web2py book   > (to be released very soon) > >  web2py_manual_78

[web2py:28752] Re: {{=T('Howto')}}

2009-08-16 Thread Iceberg
again. Sorry that my feedback doesn't provide any substantial help. Regards, Iceberg On Aug16, 10:47pm, hcvst wrote: > Hi Iceberg, > > it's a lengthy paragraph and I want to be able to translate it as one > because > the other language's word order is differe

[web2py:/] Re: Can changes in modules reload automatically?

2009-08-18 Thread Iceberg
ications.%s.modules.mymodule import MyStuff" % request.application) except: pass # Assuming it is available as a model Regards, Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" gro

[web2py:28928] Re: Can changes in modules reload automatically?

2009-08-19 Thread Iceberg
yClass"%utilsmodule) Later a ticket is issued, complaining: TypeError: super(type, obj): obj must be an instance or subtype of type when I try to do: class SubClass(MyClass): def __init__(self,blah): super(SubClass,self).__init__(blah) Well, let it be.

[web2py:28966] Re: Can changes in modules reload automatically?

2009-08-19 Thread Iceberg
On Aug19, 11:26pm, rev wrote: > Only weird thing I experience is that if I change the code in my > module I have to call it twice to see any effect. > Tried with both FF and Opera. > Still beats restarting the app. The "call it twice" might cause by the "caveat" mentioned in python document of r

[web2py:29060] Re: How to create a hidden field in CRUD?

2009-08-20 Thread Iceberg
ry'), > deletable=False) > >   return dict(form=form, target=target) It is safe to modify db.yourtable.yourfield.default to different value with each invocation to the controller. In web2py each definition are excuted on the fly. It is an unusual design but really make things fu

[web2py:29112] Re: Displaying variable in drop-down menu

2009-08-21 Thread Iceberg
On Aug21, 7:58pm, newbie_web2py wrote: > db.table_name.field1.requires= IS_IN_DB(db,'table_name.field2_name','% > (name)s') > > Can we extend the above syntax so that we can select field1 from > field2 or field3 ( with or without the drop-down menu ) ?? Don't know whether you mean this: db.tabl

[web2py:29113] Re: calling function from the view

2009-08-21 Thread Iceberg
In case you don't know, you can also put functions inside model, so that they are globally available. I think this make your controller and view have less coupling. in your model: def helperFunction(a): return a*a in your controller: def index(): return {} # much cleaner than return dict(f

[web2py:29114] Re: web2py 1.66.1 (win) zipimport.ZipImportError

2009-08-21 Thread Iceberg
On Aug22, 1:11am, mdipierro wrote: > > Note to self... never release new version before going hiking. > > Massimo Or you can release it in a name "1.x.x hiking version", hiking here means beta. :-P PS: This post is of course a "joking vers

[web2py:29120] Re: Displaying variable in drop-down menu

2009-08-22 Thread Iceberg
On Aug22, 2:55pm, Varun Kumar wrote: > db1 { >    field1} > > db2 { >    field2} > > db3 { >    field3 > > } > > db1.field1.requires = IS_IN_DB ( db2.field2 or db3.field3 ) > > what is the syntax for above IS_IN_DB statement ( is it possible to add drop > down menu also for this command ) ? If

[web2py:29233] Re: web2py recent release history

2009-08-24 Thread Iceberg
On Aug24, 7:48pm, mdipierro wrote: > http://www.web2py.com/examples/static/releases.png Mmm, interesting. Does the horizontal axis mean days passed since 2008-10-09? And what does the vertical axis mean? the svn revision or what? --~--~-~--~~~---~--~~ You received

[web2py:29230] Re: run python code from onclick event

2009-08-24 Thread Iceberg
          {{pass}} >                         {{checker=1}} >                         {{pass}} >                         >                         No, you can't do this. All the {{python code}} are executed BEFORE the final pure html page is served to the browser. In ot

[web2py:29240] Re: Questions for large deployment

2009-08-24 Thread Iceberg
ar result. C. I am not sure yet, but if plan A helps a bit, we can again use the cache trick to reuse the same db object for every request. Something like this: from applications.yourapp.modules.yourtable import _init_db db=cache.ram('my_db', _init_db(), ) Can it give another boost? Sincerely, Iceberg --~--~

[web2py:29339] Re: radical proposal

2009-08-25 Thread Iceberg
On Aug26, 12:53am, mdipierro wrote: > I have a radical proposal of changing the default length of string, > upload, password fields to 512. This will cause a migration in all > existing apps. What is the default length of string currently? If I modified my old apps to define an explicit length

[web2py:29341] Re: SQLFORM with individual HTML customization

2009-08-25 Thread Iceberg
On Aug25, 9:57pm, whs wrote: > Hi, > > I want to program our intranet site with web2py (because it is really > the best framework I found). > Because this is sort of an ERP application I need a lot of > customizations of the SQLFORMs in HTML, e.g. group the address or > communication fields in a

[web2py:29472] Re: Form and Jquery

2009-08-26 Thread Iceberg
Sorry for chime in. DataTable looks definitely cool, but I havn't tried it yet. I still wonder what is the best practice if the table content is too large (say, hundreds even thousands of records) to be transmitted on client side. Do we need to serve only part of them to the client-side DataTable

[web2py:29575] Re: clean up the session files

2009-08-28 Thread Iceberg
Glad to see a happy ending for this thread. :-) Besides, I clean up the session files by following file and it seems works well on both Windows and Linux: applications/myapp/cron/crontab 1021 * * * root **applications/admin/cron/expire_sessions.py On Aug28, 4:13pm,

[web2py:29705] Re: web2py complaints & rebuttals

2009-08-31 Thread Iceberg
pen > another one when I find it. Hi Massimo, if you don't mind, I suggest to put following code into applications/welcome/models/log.py so that it becomes a live example from out-of-box web2py. Iceberg def _init_log(): import logging,os,logging.handlers logger=logging.getLogger(request.

[web2py:29762] Re: web2py complaints & rebuttals

2009-08-31 Thread Iceberg
On Sep1, 2:00am, mdipierro wrote: > It seems to me the scaffolding app is already too heavy. Somebody has > proposed having multiple scaffolding apps. > > If you make an app with this model and a controller for reading/ > searching the logs, I will post it (for now) on appliances as an > example.

[web2py:29769] Re: Why web2py is a bad, bad thing.

2009-08-31 Thread Iceberg
from China too. :-) Iceberg On Sep1, 10:00am, weheh wrote: > I've been using web2py for around 6 months now and I thought I'd share > a bunch of reasons why I think web2py is a bad thing all around. > > I used to be an expert at all sorts of things in order to build my >

[web2py:29770] Re: web2py complaints & rebuttals

2009-08-31 Thread Iceberg
to include in the scaffolding app. > > Richard > > On Sep 1, 1:13 pm, Iceberg wrote: > > > > > On Sep1, 2:00am, mdipierro wrote: > > > > It seems to me the scaffolding app is already too heavy. Somebody has > > > proposed having multiple scaffolding

[web2py:29798] Re: Why web2py is a bad, bad thing.

2009-09-01 Thread Iceberg
On Sep1, 1:53pm, Graham Dumpleton wrote: > On Sep 1, 2:33 pm, Iceberg wrote: > > > Weheh, I have to say, you are a bad, bad guy. Because when I saw the > > title of your post, I was ready for a fight and rushed to see your > > post. But after reading, I lost the re

[web2py:30000] Re: Complex Queries for DAL?

2009-09-03 Thread Iceberg
On Sep4, 8:19am, Bottiger wrote: > Is there any mechanism in the DAL for things like > > "INSERT if not exists" > > "INSERT or ignore" > > upserts? > > Or do I need to resort to using executesql? How about: try: crud.create(...) except: response.flash='Error is ignored' --~--~-~--~-

[web2py:30002] Re: Dynamic Side bar

2009-09-03 Thread Iceberg
On Sep4, 5:19am, eddwinston wrote: > I am very very new to web2py and I love it. I am trying to have a > dynamic side bar/side bar menu. How can I do that? Do I have to create > a view and then pass in value from all the controller actions in the > app? Perhaps you can find some idea after study

[web2py:30003] Re: multiple forms per page -- preventing double submission

2009-09-03 Thread Iceberg
On Sep4, 8:27am, weheh wrote: > That isn't the issue, Richard. The issue is that if you submit and > then hit the browser's refresh button, it shouldn't resubmit the form, > which would be a double submission. When a single form is employed, I > believe the session contains a variable that is com

[web2py:30088] Proposal about enhancing OptionsWidget

2009-09-04 Thread Iceberg
] else: # To enforce an explicit choice when creating new record opts = [OPTION(_value='')] Please give it a try and hope you will like it. Regards, Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[web2py:30091] Proposal about easier validators i18n

2009-09-05 Thread Iceberg
n: IS_NOT_IN_DB.error_message = T('value already in database!') # class wide ... db.Field('foo', requires=IS_NOT_IN_DB(db,"table.field")) db.Field('bar', requires=IS_NOT_IN_DB(db,"table.field2")) Same proposal applies to all other validat

[web2py:30094] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
]),IS_EXPR("str(value) != > 'Please choose...' ")] > > It could just be a convention that requires[0] is IS_IN_SET (similar > to how IS_NULL_OR works currently). > > On Sep 4, 11:58 pm, Iceberg wrote: > > > > > Hi Massimo, > > > My first web

[web2py:30098] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
On Sep5, 5:25pm, Fran wrote: > On Sep 5, 5:58 am, Iceberg wrote: > > > So my proposal is to adjust OptionsWidget to always show up with an > > initial blank (when creating record), but not necessarily accepting > > it. Just change line 198 of sqlhtml.py from: > >

[web2py:30116] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
points. Please also take that into consideration. On Sep5, 8:34pm, mdipierro wrote: > You can already set a default Field(...,requires=IS_IN_SET > (...),default='value') > > On Sep 5, 5:44 am, Iceberg wrote: > > > > > On Sep5, 5:25pm, Fran wrote: >

[web2py:30117] Re: Proposal about easier validators i18n

2009-09-05 Thread Iceberg
Does this mean there is no objection, and the i18n-able validators will soon be available in trunk? :-) On Sep5, 8:27pm, mdipierro wrote: > I agree with Fran. > > On Sep 5, 4:21 am, Fran wrote: > > > > > On Sep 5, 8:29 am, Iceberg wrote: > > > > Currently

[web2py:30136] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
On Sep5, 11:51pm, "mr.freeze" wrote: > Perhaps a better solution is checking if the value for 'default' > argument is *not* in the set and then appending it to the set but not > allowing it to pass validation if selected.  What do you think? > You are a genius! This solution reaches the original

[web2py:30151] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
turn SELECT(*opts, **attr) On Sep6, 2:32am, "mr.freeze" wrote: > Iceberg, do you want to submit a patch? Massimo, do you have any > issues with this change? I verified that it works when multiple=True > as well. > > > > On Sep5, 11:51pm, "mr.freeze" wrote

[web2py:30157] Re: Proposal about enhancing OptionsWidget

2009-09-05 Thread Iceberg
alue=value)) return SELECT(*opts, **attr) On Sep6, 2:49am, "mr.freeze" wrote: > Iceberg, did you see my previous message about inserting the option at > the *top* of the list?: > > > > On Sep6, 2:32am, "mr.freeze" wrote: > > > > Iceberg, do you w

[web2py:30203] Re: two tables, one form

2009-09-05 Thread Iceberg
Perhaps the standard trick still helps? I did not try it. db.table1.field1.readable=db.table1.field1.writable=False db.table2.field2.readable=db.table2.field2.writable=False On Sep6, 10:50am, weheh wrote: > Thanks for the quick response, Massimo. I'll try it out. However, > could you also sh

[web2py:30219] Re: two tables, one form

2009-09-06 Thread Iceberg
eadable = False # field is hidden On Sep6, 2:24pm, weheh wrote: > Thanks Iceberg, but I'm not familiar with the "standard trick" -- > could you point me to some documentation on such? > > On Sep 5, 11:51 pm, Iceberg wrote: > > > > > Perhaps the standard tr

[web2py:30302] Re: Proposal about enhancing OptionsWidget

2009-09-07 Thread Iceberg
(...,requires=IS_IN_SET(('a','b','c'),zero=T('choose one'))) > > > > the option "zero" will be added at top but not accepted unless: > > > > Field(...,requires=IS_NULL_OR(IS_IN_SET(('a','b','c'),zero=T(&#

[web2py:30306] Re: Proposal about enhancing OptionsWidget

2009-09-07 Thread Iceberg
a dropdown: > > form=SQLFORM.factory(Field('choice',requires=IS_IN_SET > (('Yes','No','Maybe')),widget=SQLFORM.widgets.radio.widget)) > > On Sep 7, 11:23 am, "mr.freeze" wrote: > > > > > Yeah, it doesn't feel as el

[web2py:30364] Re: Odd form behavior with multiple forms

2009-09-07 Thread Iceberg
se problem. Regards, Iceberg On Sep8, 8:43am, Alastair Medford wrote: > Aha, I didn't think the solution would be so simple. Thanks > > On Sep 7, 3:35 pm, mdipierro wrote: > > > > > It is because of mechanism to prevent double form submission. It > > breaks w

[web2py:30365] Re: How Can I get the request.uri in Web2py

2009-09-07 Thread Iceberg
ationname/appadmin/state > > F Glad to know this source. I used to visit here. http://localhost:8000/examples/simple_examples/status Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users"

[web2py:30393] Re: two tables, one form

2009-09-08 Thread Iceberg
other fields have validators that > complain and tack on their error messages onto form.errors. > Consequently, the form.accepts fails. > > Is the only way to ignore these other fields to do the trick thing > described by Iceberg > (db.table1.field1.readable=db.table1.field1.wr

[web2py:30462] Re: two tables, one form

2009-09-08 Thread Iceberg
ve submit a patch to Massimo about "no redirect by default". Hope he will like it. Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to

[web2py:30555] Re: get random record efficiently

2009-09-09 Thread Iceberg
andom total_count = db(db.mytable.id>1).count() # well, this is one extra db query random_id = random.randint(1, total_count) random_record = db.mytable[random_id] # Does this work on GAE? Iceberg --~--~-~--~~~---~--~~ You received this message because you are subs

[web2py:30569] Re: get random record efficiently

2009-09-09 Thread Iceberg
mytable.ALL,orderby=',limitby= > (0,1))[0] > > On Sep 9, 8:27 pm, Iceberg wrote: > > > > > On Sep9, 8:07pm, Richard wrote: > > > > hi, > > > > is there an efficient way to get a random record from a table? > > > An obvious non-efficient

[web2py:30576] Re: action based on received email

2009-09-09 Thread Iceberg
s Everyone > > Victor With no doubt, this is not a web server question at all. You need to setup (and customize) an email server to reactive on special mail. Try to learn whatever email server then you will find your clue. That is the only direction. Iceberg --~--~-~--~~---

[web2py:30686] Re: autocomplete

2009-09-10 Thread Iceberg
is also a good IDE. I am using it too. I think Limodou would be happy to know ulipad has one more international user, from Japan. Welcome on board Teru. :-) PS: Sorry for this slightly off-topic post. -- Iceberg --~--~-~--~~~---~--~~ You received this message b

[web2py:30834] Re: Separation of Concerns

2009-09-12 Thread Iceberg
st happened that the "description" in controller, has a default appearance even without a view, which could make MVC-believer confused. Hope my explanation make some sense. By the way, I remember there was a deep discussion on this MVC topic in this mail list, but I just did not dig it o

[web2py:31087] Re: Generic view

2009-09-15 Thread Iceberg
On Sep16, 12:19pm, Arvind wrote: > Hello, > > When i see the examples, the basic form example..which is controlled > by > form_examples.py > > has no view. > > I believe that a generic view kicks in here, when no view is found for > that controller. > > how is this view working ? can somebody ple

[web2py:31111] Bug in cron rev1189?

2009-09-16 Thread Iceberg
urpose of the former, but at least the latter causes a bug when using "hard" cron mode. My tasks defined as "10 1 * * * blah" are still invoked hourly. Hope above information is enough for reproduce the bug. Sincerely, Iceberg --~--~-~--~~~---~--~---

[web2py:31156] Re: response.flash

2009-09-16 Thread Iceberg
he problem doesn't exist in "welcome" app, that is "your" app's problem. Fair enough? :-) Iceberg On Sep17, 12:27am, mdipierro wrote: > Are you using the default layout.html? If not, is there anything like > {{=response.falsh or 'no flash'

[web2py:31164] Re: Custom form builder appliance?

2009-09-16 Thread Iceberg
Do you mean something like this? http://web2py.appspot.com/survey/survey/index On Sep17, 8:24am, Tim McNamara wrote: > Hi there, > Has anyone developed a form builder as an appliance? Something that will > allow administrators to create forms and then build reports from the > inputted data? > >

[web2py:31179] Re: Custom form builder appliance?

2009-09-16 Thread Iceberg
It really looks cool. If the generated form code can have client-side validation, then it will be perfect. On Sep17, 10:39am, mdipierro wrote: > I think we can do better than that. Like this for > example:http://www.phpform.org/ > > On Sep 16, 9:13 pm, Iceberg wrote: > >

[web2py:31180] Re: pre-filling non writable form value

2009-09-16 Thread Iceberg
Try: db.table.time.default=getCurrentTime() db.table.time.writable=False form = SQLFORM(db.table) if form.accepts(...) On Sep17, 12:33pm, Alastair Medford wrote: > What I'm trying to do is preset the value of a non writable field in a > form, such as a time field. Something to the effect of: >

[web2py:31186] Re: pre-filling non writable form value

2009-09-17 Thread Iceberg
to it, you find a brand new world. :-) Iceberg On Sep17, 2:18pm, Alastair Medford wrote: > No dice. Neither of the two lines had any effect (this is with them in > the controller). The field was blank and was still writable. Also, if > this approach worked, or if I changed the default valu

[web2py:31187] Re: response.flash

2009-09-17 Thread Iceberg
gt; stick to it. > > Thanks once again for so much help and kindness. > > cheers > Arvind > > On Sep 16, 7:54 pm, Iceberg wrote: > > > > > Or more precisely, there are some lines like these in the default > > layout.html: > > >         {{if respons

[web2py:31203] Re: Can't get the form to validate...

2009-09-17 Thread Iceberg
pon a time, I did not know how to customize forms so I build my own forms manually. Before long I realized the code becomes unmaintainable quickly. So, come back before it is too late, let's do things in a web2pythonic way, pal. Regards, Iceberg On Sep17, 6:00pm, encompass wrote: > I am try

[web2py:31208] Re: Bug in cron rev1189?

2009-09-17 Thread Iceberg
: > IIRC in that particular code snippet -1 was deprecated in favor of the > more standard @reboot keyword. I have not noticed such a bug, but will > certainly check it out for a possible regression. > > On Sep 16, 4:23 pm, Iceberg wrote: > > > > > Hi Achipa or Kacper,

[web2py:31241] Re: pre-filling non writable form value

2009-09-17 Thread Iceberg
till has good enough benchmark result. Hope they help you too. Regards, Iceberg On Sep18, 1:22am, Alastair Medford wrote: > this method still leaves a bad taste in my mouth. > Since every request is also sending a table redifinition, this seems > like un-needed overhead. This also h

[web2py:31295] Where is sneaky webserver?

2009-09-18 Thread Iceberg
The latest rev1232 introduces a sneaky web server, but it seems not exist? File "C:\DOWNLOAD\web2py-trunk\gluon\main.py", line 32, in import sneaky ImportError: No module named sneaky --~--~-~--~~~---~--~~ You received this message because you are subscribed

[web2py:31298] Re: Form Key

2009-09-19 Thread Iceberg
But why bother? web2py's SQLFORM in controller contains built-in server-side validation and other goodies. Besides it sets up correct form key for you, of course. And you can always customize the view to whatever you want to. So why insist to do things in opposite direction, which drown you in unn

[web2py:31299] Re: Where is sneaky webserver?

2009-09-19 Thread Iceberg
ree: > > http://bazaar.launchpad.net/~mdipierro/web2py/devel/files/head%3A/gluon/ > > When I get the update from launchpad, it seems to be running just fine... > > > > On Sat, Sep 19, 2009 at 1:15 AM, Iceberg wrote: > > > The latest rev1232 introduces a sneaky we

[web2py:31306] Re: Interesting issue: need to call a method from a value in a table.

2009-09-19 Thread Iceberg
In python, it is easy. >>> def foobar(): print 'hello world' ... >>> exec('foobar'+'()') hello world >>> However, the exec() might be considered dangerous if you are not sure what function name string would be inside DB. So if I were you, I would still use a translation system, but a more elegan

[web2py:31308] Re: for row in rows

2009-09-19 Thread Iceberg
The first 3 lines of your code snippet can be changed into: {{for count, item in enumerate(news):}} That is more pythonic. Using counter variable is the bad taste from C era. On Sep19, 3:32pm, Jason Brower wrote: > Hmm... > Is this what you where thinking? > > On Sat, 2009-09-19 at 00:27 -0

[web2py:31312] Re: Where is sneaky webserver?

2009-09-19 Thread Iceberg
23pm, mdipierro wrote: > Here is a better version: > >    http://web2py.com/examples/static/sneaky.py > > and woila' a Python 3.0 version: > >    http://web2py.com/examples/static/sneaky3.py > > Massimo > > On Sep 19, 2:06 am, Iceberg wrote: > > > >

[web2py:31315] Re: Form Key

2009-09-19 Thread Iceberg
Yes, customizing the SQLFORM or FORM is the correct way. See also this. http://www.web2py.com/AlterEgo/default/show/205 On Sep19, 5:15pm, Yarko Tymciurak wrote: > form.custom  (see p. 219 in the manual, for example) > > > > On Sat, Sep 19, 2009 at 4:10 AM, eddwinston wrote: &

[web2py:31362] Re: Multiple buttons in one form

2009-09-19 Thread Iceberg
iple submit buttons, try some javascript technique mentioned in following post, although that way we need multiple actions in our controller, which is not DRY enough. :-/ http://www.phpbuilder.com/board/showthread.php?t=10248489 Anybody who knows a better solution, please correct me. Thanks in advance!

[web2py:31368] Re: Multiple buttons in one form

2009-09-20 Thread Iceberg
On Sep20, 12:48pm, Iceberg wrote: > On Sep20, 11:57am, weheh wrote: > > > OK, here's a way to do it: > > > {{=form.custom.begin}} > > > name="process">Process > > > > {{=form.custom.submit}} > > {{=form.custom.end}} > >

[web2py:31370] Re: crud.create(db...,next="...[id]") error

2009-09-20 Thread Iceberg
'. The source code has many snippets like this. if next and not next[0] == '/' and next[:4] != 'http': next = self.url(next.replace('[id]', str (form.vars.id))) I don't know the reason for requiring a leading '/&

[web2py:31372] Re: Client tools for web2py

2009-09-20 Thread Iceberg
On Sep20, 2:14am, "mr.freeze" wrote: > Hi folks, > > I just wanted to share a module that I'm working on for a > project. It contains tools for managing client events and resources > from the server. Here are the main features: > > 1) Dynamic inclusion and downloading of resources (scripts/

[web2py:31401] Re: file descriptors leak

2009-09-21 Thread Iceberg
on from google svn rev1222. Is the leak found by Zahariash already fixed in this revision? After kill and restart, now everything seems ok. Anyway, I will keep close look to my production server, and come back to you if anything new happened. Iceberg. --~--~-~--~~~---~--~

[web2py:31411] Re: file descriptors leak

2009-09-21 Thread Iceberg
rimental server. It still has come problems. > I will revert to cherrypy for now > > Massimo > > On Sep 21, 4:16 am, Iceberg wrote: > > > > > On Sep11, 5:13pm, zahariash wrote: > > > > On 11 Wrz, 07:13, mdipierro wrote: > > > > > ple

[web2py:31474] Re: crud.create(db...,next="...[id]") error

2009-09-22 Thread Iceberg
enal URL (starts with http:, ftp: etc.) > > On Sep 21, 11:20 am, Yarko Tymciurak wrote: > > > > > sounds like this needs to be straightened out;  probably deserves some > > discussion (as Iceberg suggests)... > > > Massimo - can you add your thoughts to this? > &

[web2py:31592] Re: crud.create(db...,next="...[id]") error

2009-09-23 Thread Iceberg
actual;  what is really desired) > for this "[id]" replacement. > > Let's get to that first, shall we? > > THEN we can discuss the various path contexts > > > > On Tue, Sep 22, 2009 at 11:30 AM, Iceberg wrote: > > > Sorry, still don't get

[web2py:31665] Addressbook by web2py?

2009-09-25 Thread Iceberg
Trying to search an addressbook app written by web2py (and probably write one by myself, if I did not find a handy one). Then I found this: http://www.ohloh.net/p/listbook but can not access its code. Is its author in this maillist? Or does anyone know an alternative? Regards, Iceberg

[web2py:31743] Re: SEO for Default.py

2009-09-27 Thread Iceberg
One relevant question: how SEO-efficient it is, if our controller defines some good keywords into following variables? response.title response.keywords response.description I noticed that they are used in the default layout.html Sincerely, Iceberg

[web2py:31850] Re: selecting part of model to run

2009-09-28 Thread Iceberg
many controllers, each defines and uses its 4 to 6 tables. Mmm, the idea doesn't sound good because it violates MVC but, if you want to. --- Iceberg --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "web

[web2py:31911] Re: Logging module

2009-09-30 Thread Iceberg
de_log',lambda:_init_log (),time_expire=None) On Sep28, 9:13pm, mdipierro wrote: > Some time ago Iceberg suggesting adding the following model for > logging: > > Add following codes inside model/log.py: > >  def _init_log(): >    import logging >    logger=logging.

[web2py:32137] Re: Client tools for web2py

2009-10-02 Thread Iceberg
On Oct2, 12:42pm, "mr.freeze" wrote: > New version.  Another round of bug fixes and feature additions. There > is now a demo appliance that includes all of the examples and a tool > for testing the JQuery class. > > http://www.web2pyslices.com/main/slices/take_slice/8 Congratulations! And I th

[web2py:32138] Re: Unicode support for class StringWidget(FormWidget) at web2py.gluon.sqlhtml

2009-10-02 Thread Iceberg
@AndCycle: I believe Massimo's suggestion should solve the problem. One more tips. If you put this line at the beginning of your source code, # coding: utf8 and making sure your source code file itself is in utf8, then you can simply try: Field('rating', type='string', default='普遍') Much str

<    1   2   3   4   5   6   7   >