thank you, very helpful.
On Thursday, March 21, 2013 11:57:40 PM UTC+3:30, Niphlod wrote:
just to clear out doubts.
a field 'reference sometable' gets:
- a foreign key to the id of sometable
- a validator that by default builds up on the format argument of
sometable
you CAN'T have
thank you so much for your hint, anthony, but when i test it both of it
return an error, any idea about this?
IS_IN_DB(db(db.room.status=='Available'), db.room.id,
label=lambda r: '%s %s' % (r.room.branch.address, r.room.room_no))
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
i still can access it both of web2py.com and my own
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options,
i still can access it both of web2py.com and my own
All fine from both Italy and Germany
--
Roberto De Ioris
http://unbit.it
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from
Ok great and thanks for all your help, the file is being saved and all
works as expected!!! code that works below:
def index():
form = SQLFORM.factory(Field(first_name),Field(quotes_file,
upload, uploadfolder=os.path.join(request.folder, 'uploads')))
test = ''
first_name = ''
if
I want to read the douce code of web2py ,but three are no good code reader.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Hello All,
I am a newbie to web2py and developing my test app. I want to present all
the entries in a db using SQLFORM.grid with the option to edit/delete rows
based on user name.
e.g.
My models are like:
Person table with entries name, userid, address, phone number.
Controller looks like
Sure. As long as what can and cannot be expected from the functions is
clear, I'm happy with your way!
Le jeudi 21 mars 2013 16:44:17 UTC+1, Niphlod a écrit :
my point exactly it's a matter on how it's perceived as a
one-solution-for-all-exporting-problem vs a rapid way to load
ehm ? what ?
On Friday, March 22, 2013 9:06:51 AM UTC+1, RunSky ruan wrote:
I want to read the douce code of web2py ,but three are no good code reader.
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and
Thanks Massimo,
I realize now that those variables are also in **vars (request.restful
interfacehttp://www.web2pyslices.com/slice/show/1533/restful-api-with-web2py
)
I wonder how conflicts between query parameters and body parameters are
resolved.
BR,
Daniel
On Friday, March 22, 2013 6:02:32
Hi,
On 22/03/13 09:29, Niphlod wrote:
ehm ? what ?
I was intrigued, so had a Google...
The OP seems to want something like this: -
http://www.sourceinsight.com/
...which seems to be inspired by this: -
http://cscope.sourceforge.net/
...which in turn led me to this: -
Hi EveryOne,
i want to ask about the textvalidation in web2py, i have a form with few
mandatory fields
when user submit the form without fillling these fields, an error or alert
generated right below every field but when user start typing it still
remains untill you submit the form,
I want to
On Friday, March 22, 2013 4:33:48 AM UTC, Cliff Kachinske wrote:
The Python anywhere web site was down earlier today.
There was a brief outage at 13:40 UTC on 21 March while we upgraded the
system -- is that the downtime you meant? We're not aware of any other
outages, but if you saw
Thanks,
This solution is working fine for the edit part. You gave me a better
understanding of the form validation mechanism, thanks.
However I think I'm gonna go with luismurciano's approach which seems
closer to what I am looking for...
Thanks again for your help!
Le jeudi 21 mars 2013
Thanks, awesome answer !
I think I'm gonna go with the table callback method, I kind of feel safer
when doing security checks closer to the DB (maybe I'm wrong...)
- For the second solution (Authorization), as I am using a sqlform.grid,
I need to provide a query and not rows. So I tried
I recently found out how to add an additional field to the auth_user table,
but then I found that the registration page for a new user has a spot in
the form to input a value for the extra field. In many cases, this is
desired, but I want this particular field to not appear in the registration
Hi
I try to send a json string to a json service but I am geting invalid
request all the time. The echo service is works with normal string.
do you have any idea
Thanks
/F
@service.json
def echo(data):
echo test
return data
My client
things = [hi,ho]
url =
Sorry, wasn't thinking -- the validator is selecting a record from the
room table, not the booking table, so you'll need a slightly different
function for that:
IS_IN_DB(..., label=lambda r: '%s %s' % (r.branch.address, r.room_no))
or if want to use a single function (not tested):
def
1. How can I view a currently cached value, without any possibility of
changing it?
2. Say I have this code:
def getvalue():
try:
return function_that_may_not_complete()
except:
return None
cache.ram('MyValue', lambda: getvalue(), time_expire=60*60*24)
If
this is one of the design patterns of the cache in web2py that makes a
little more cumbersome than others cache interface to understand ...
assuming you're using cache.ram, when you do
cache.ram(key, value, 60)
for the first time what you're really doing is store value, tag it with
key and 60
Maybe this would work:
cache.ram('MyValue',
lambda: getvalue() or cache.ram('MyValue', lambda: None,time_expire
=None),
time_expire=60*60*24)
Calling cache.ram() with time_expire=None always retrieves the currently
stored value, so you can assign that if getvalue() returns
Eu havia conseguido fazer o admin funcionar, e quando acessei a página da
aplicação deu um erro:
Traceback (most recent call last):
File /home/igrejarama/webapps/rama/web2py/gluon/restricted.py,
line 212, in restricted
exec ccode in environment
File
Niphlod and Anthony,
Thanks so much for your comments which have assisted me both to understand
and get it working.
It seems that I missed the following paragraph in the book:
time_expire = None
Forces retrieval of the cached value, regardless of the time elapsed since
it was saved (if
With the SELECT, better initialisation and no more roundtrip to get the
value representation :
def autocomplete_typeahead_widget(field, value, referenced_table,
represent_field, id_field, controller, **kwargs):
table_name = field._tablename
field_name = field.name
field_requires =
you're trying to send a (likely) unparseable string as arg instead of a var.
i.e.
http://whatever/app/services/call/json/echo/possibly_bogus_characters_not_allowed_in_a_uri
first of all make sure that your services.py holds the
def call():
session.forget()
return service()
function
Do I just need to write a custom form and a custom handler for the post,
or is there an easy way to do this?
You could set the the readable and writable attributes to False only if the
scaffolding registration action is called:
if request.function == user and register in request.args:
It returns all the rows which are visible in view. My requirement is that
I want to make edit/delete button visible only for the user's
whose userid is same as some predefined value SOMEUSER, for other
userid's edit/delete button should be disabled/not visible.
Can some one please tell me on
I found a cleaner solution after some digging. In db.py, after creating the
auth object, include the line:
auth.settings.register_fields = ['id', 'first_name', 'last_name', 'email',
'password']
or if when you created the auth object you passed in username=True, include
the line:
I have a MSSQL database with a 4 column primary key:
dbcomercial.define_table('libros',
Field('bloque',writable=False),
Field('grupo',writable=False),
Field('sector',writable=False),
So help me out here...
I have this code:
def saveAddress():
#session.forget(response)
houses = None
useCached = True
if request.post_vars.address:
useCached = False
newhouse = db.house.insert(address=request.post_vars.address,person
I don't know legacy primary key web2py feature, but it is strange if your
premarykey fields are writable=false how could it be possible to fill those
records since they will not be accessible in your form?
At the end of the section about legacy table in the book :
Why don't you just have a webpage, have the display of current values on
top, a single form below for adding items, and submit as you go?
On Thursday, March 21, 2013 9:14:05 AM UTC-7, Richard wrote:
Hello,
I have a bizzard case where I need to set the number of input (more number
of rows
adding session.forget() just means that you don't need to use session
variables in that controller. it has nothing to do with cache
Anyway, time_expire=0 means store this item in cache using this key
On Friday, March 22, 2013 7:42:58 PM UTC+1, Derek wrote:
So help me out here...
I have
Thanks . it is working now.
Den fredagen den 22:e mars 2013 kl. 13:00:04 UTC+1 skrev frasse:
Hi
I try to send a json string to a json service but I am geting invalid
request all the time. The echo service is works with normal string.
do you have any idea
Thanks
/F
@service.json
A good one. And for you initial requirement which was taking a particular
field out of the form (not choosing the whole set of fields that the
registration form should show), this is more compact, specially if you are
populating the scaffolding auth_user table with custom fields:
Folks,
How could I implement:
SELECT * FROM (SELECT * FROM capitulo WHERE data = CURDATE() ORDER BY
data) WHERE encerrada = false GROUP BY c.cod_anothertable
Regards,
Tito
--
Linux User #387870
.
_/_õ|__|
..º[ .-.___.-._| . . . .
.__( o)__( o).:___
--
---
You
written as it is, in a view :P
we need models, test data and the resultset you want returned, plase ^_^
On Friday, March 22, 2013 11:00:12 PM UTC+1, Tito Garrido wrote:
Folks,
How could I implement:
SELECT * FROM (SELECT * FROM capitulo WHERE data = CURDATE() ORDER BY
data) WHERE
db.define_table('novela',
Field('nome', requires=IS_NOT_EMPTY()),
Field('emissora', 'reference emissora', requires = IS_IN_DB(db,
db.emissora.id,'%(nome)s')),
Field('encerrada', 'boolean', default=False),
Field('slug', requires=IS_SLUG()),
Field('logo', 'upload',
I'm trying to write a simple loop in default.py. What's wrong with this
below? Thanks, Alex Glaros
def new2():
y=5
while y 0:
response.write='Phowdy/P'
y=y-1
pass
--
---
You received this message because you are subscribed to the Google Groups
web2py-users
My google-fu has not helped me come up with an answer...
Django has a set of template filters they call humanize which will add a
nice touch to data. (Java also has a lib called PrettyTime.) For example it
will convert Fri Mar 22, 20:23 into 4 minutes ago, or Fri Mar 21 into
yesterday. Is
Sure, described here:
http://web2py.com/books/default/chapter/29/14#Pretty-dates
Regards,
Ales
On Saturday, March 23, 2013 2:27:32 AM UTC+1, Ricardo Cárdenas wrote:
My google-fu has not helped me come up with an answer...
Django has a set of template filters they call humanize which will
Got it - thanks.
On Friday, March 22, 2013 8:27:32 PM UTC-5, Ricardo Cárdenas wrote:
My google-fu has not helped me come up with an answer...
Django has a set of template filters they call humanize which will add a
nice touch to data. (Java also has a lib called PrettyTime.) For example it
I thougth about something like that, keep adding row and submit row with
ajax...
Richard
On Fri, Mar 22, 2013 at 3:32 PM, Derek sp1d...@gmail.com wrote:
Why don't you just have a webpage, have the display of current values on
top, a single form below for adding items, and submit as you go?
response.write() is a method, not an attribute (even if it were an
attribute, you would be overwriting it repeatedly, not appending to it).
Anthony
On Friday, March 22, 2013 6:51:01 PM UTC-4, Alex Glaros wrote:
I'm trying to write a simple loop in default.py. What's wrong with this
below?
I'm having trouble working this one out. I've tried using the example in
the book with no success.
Model:
db.define_table('file',
Field('client', 'reference client'),
Field('file', type='upload', autodelete=True),
Field('filename', 'string'),
format='%(file)s')
Controller:
def
very nice, it's work well, thank you so much for your hints, anthony.
just want to share the code that you've guide.
def format_room(record):
return '%s-%s' % (record.branch.address, record.room_no)
def format_booking(record):
return '%s-%s %s-%s-%s' % (record.scheduled_start,
just curious, is it possible to add the format function in the table room?
*e.g. 1. no error but the result is not expected*
db.define_table('room',
Field('room_no'),
Field('category', 'list:string'),
Field('status', 'list:string'),
Field('branch', 'reference branch'),
47 matches
Mail list logo