Hi,
I have this db model:
db.define_table('patients',
Field('name', 'string', length=32),
Field('firstname', 'string', length=32),
Field('dob', 'date'),
format='%(name)s')
db.define_table('dataset1',
Field('date', 'date', length=32),
Field('param1', 'string', length=50),
specific.
>
> If you don't have too many records you can do:
>
> rows = ( db(db.dataset1).select() | db(db.dataset2).select() ).sort(lambda
> row: row.date)
>
>
>
> On Saturday, 15 December 2012 08:43:35 UTC-6, Mamisoa Andriantafika wrote:
>>
>>
c.
>
> If you don't have too many records you can do:
>
> rows = ( db(db.dataset1).select() | db(db.dataset2).select() ).sort(lambda
> row: row.date)
>
>
>
> On Saturday, 15 December 2012 08:43:35 UTC-6, Mamisoa Andriantafika wrote:
>>
>> Hi,
>>
&g
headaches in
> the future.
>
> On Sunday, 16 December 2012 03:15:46 UTC-6, Mamisoa Andriantafika wrote:
>>
>> Hi again,
>>
>> "|" seems not to work because the column numbers is different between the
>> 2 tables?
>>
>>
>> Le samedi
and join]
ORDER BY
latest_date
Is is possible using to process it using DAL?
Le dimanche 16 décembre 2012 17:40:22 UTC+1, Mamisoa Andriantafika a écrit :
>
> Sorry I still get: "Cannot | incompatible Rows objects".
>
> I'll change the field name "date" y
rom the view. You would need to
> create a model (readonly) to access the view.
>
> On Wednesday, 19 December 2012 16:19:33 UTC-6, Mamisoa Andriantafika wrote:
>>
>> Best results to UNION I could have was using the mutex table trick:
>>
>> http://www.xaprb.com/blo
I have pb to show the coalesce date in view.
I tried;
exams_mutex['COALESCE(dataset1.date,dataset1.date)']
but it is not working?
Le jeudi 20 décembre 2012 23:40:15 UTC+1, Mamisoa Andriantafika a écrit :
>
> I finally found the solution using COALESCE to merge and order
I actually need to display those coalesce dates out of SQLTABLE that I use in
view.
To be precise, I need to show in LI(date, LI(all parameters)).
--
ok find it too using this code in view:
{{for e in exams_mutex:}}
Examen du {{=e['COALESCE(dataset1.date,dataset2.date)']}}
{{pass}}
Le samedi 22 décembre 2012 08:27:03 UTC+1, Mamisoa Andriantafika a écrit :
>
> I actually need to display those coalesce dates out of SQLTABLE
Hi,
With this code:
@request.restful()
def icd10():
import libxml2
icd10_xml = libxml2.parseDoc(open('/home/www-data/web2py/applications'+
URL('static','icd10/icd10cm/Tabular.xml'),'r').read())
response.view = 'generic.xml'
def GET(**vars):
search_str = request.vars.searc
gt;
> On Saturday, June 11, 2016 at 5:25:38 PM UTC-4, Mamisoa Andriantafika
> wrote:
>>
>> Hi,
>>
>> With this code:
>>
>> @request.restful()
>> def icd10():
>> import libxml2
>> icd10_xml = libxml2.parseDoc(open(
>>
Hi,
Here is a simple controller.
def test_fpdf():
from gluon.contrib.pyfpdf import FPDF, HTMLMixin
title = "This The Doc Title"
heading = "First Paragraph"
text = 'bla'
# create a small table with some data:
rows_body = []
for data in db(db.person.id > 0).select():
Thanks!
Le mercredi 7 décembre 2016 18:49:57 UTC+1, Paolo Valleri a écrit :
>
> see
> https://github.com/reingart/pyfpdf/blob/master/docs/reference/write_html.md
> for a detailed example for using write_html
>
> Paolo
>
> On Tuesday, December 6, 2016 at 10:23:46 PM UTC+
[SQLFORM.grid] fields order in view / request.args(0)
Hi,
I have 2 questions relative to this controller:
def p_list():
# i = request.args(0) or 7 // not working, invalid literal base 10 on
edit/profile
i = 7
grid = SQLFORM.grid(db.auth_membership.group_id==i,
Thanks a lot to both of you.
Le dimanche 8 novembre 2015 02:53:04 UTC+1, Anthony a écrit :
>
> 1) Using the commented line, the view is working but if I edit/profile, I
>> get a ticket error with: ValueError: invalid literal for long() with base
>> 10: 'edit'
>> with or without the args. I cann
Hi,
I'm trying to ajust the output of the REST services.
Here is my code:
@request.restful()
def api():
response.view = 'generic.json'
def GET(tablename,**vars): # GET VALUES
if not tablename=='test': raise HTTP(400)
if request.vars.search == None:
return dict
quot;'+tablename+'": ['
concat = '{ "Result": "OK", "Records": ['
# concat = '{ "'+tablename+'": ['
for row in rows:
concat = concat + json.dumps(row)+","
concat = concat.s
e. i cannot
> find how to do it?
>
> 2016-02-13 19:33 GMT+02:00 Mamisoa Andriantafika >:
>
>> Ok here is my answer:
>>
>> # RESTFUL CRUD
>> @request.restful()
>> def api():
>> import json
>> response.view = 'generic.json'
>
Hi,
Using the REST service, a GET doesn't show the fields from auth_signature.
Is there a way to make them visible from the REST api?
Mike
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2
Hi,
This is the code I use to render a ROW in JSON. You also have to XML it to
render it correctly in view.
def rows2json (tablename,rows):
import datetime
import json
def date_handler(obj):
if isinstance(obj, datetime.datetime):
return obj.strftime(str(T('%d/%m/%
home_num_pid11_1', 'integer'),
Field('box_num_pid11_2', 'string'),
Field('address1_pid11_3', 'string'),
Field('address2_pid11_4', 'string'),
Field('zipcode_pid11_5', 'string'),
Field(
t only returns readable fields (notice you're also not getting
> id_auth_user), so temporarily set all the fields to readable.
>
> Anthony
>
> On Monday, April 18, 2016 at 10:11:59 AM UTC-4, Mamisoa Andriantafika
> wrote:
>>
>> Hi,
>>
>> Here is
Hi,
Using this usual REST code in controller :
def api_users():
response.view = 'generic.json' # or 'generic.' + request.extension
def GET(*args,**vars):
patterns = [
"/user[auth_user]",
"/user/{auth_user.id}",
"/user/{auth_user.id}/:field",
15:59:49", "maiden_name_pid6":
"Li\u00e9", "idc_num": "", "dob_pid7": "1978-01-01"}]}
but if I add the search with the accent:
https://localhost/test/default/api_users/user/maï/lié/1978-01-01
{"content":
trying to generate this URL or you receive
> the request? Does it fails for a request you receive?
>
> On Sat, Apr 23, 2016 at 8:38 PM, Mamisoa Andriantafika > wrote:
>
>> Just to be clearer, here is a response from the following get:
>>
>>
>> http
Hi,
I did try but still not working.
Le mardi 26 avril 2016 17:05:52 UTC+2, Leonel Câmara a écrit :
>
> You need to url encode those characters. Have you tried that?
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- ht
Thank you I will do post an issue.
Le mercredi 27 avril 2016 00:16:39 UTC+2, Leonel Câmara a écrit :
>
> You cannot have unicode characters in the path of an URL that is not a
> valid URL. If percent encoded path components do not work then it is a
> bug/missing feature. If you submit an issue i
Hi,
>From this model
db.define_table('address',
Field('id_auth_user', 'reference auth_user', writable = False, readable
= False),
Field('zipcode', 'string', required=True),
Field('town', 'string', required=True),
Field('country, 'string', required=True),
auth.signature)
So
Hi,
I would agree that the docs should be updated: download page, deployment in
web2py group etc...
Le mardi 10 avril 2018 00:10:35 UTC+2, Jurgis Pralgauskis a écrit :
>
> Would be good if Py3 support would be highlighted in Instructions
> http://web2py.com/init/default/download
> as now it
Hi,
I can't seem to find how to modify the one-step installation script so that
web2py uses python 3.
I tried pip3 venv on wen2py directory without success. It still shows
(Running on Apache/2.4.29 (Ubuntu), Python 2.7.15rc1.
Server is a fresh ubuntu server 18.04.
any ideas?
--
Resources:
Hi,
I uses the 2nd link (python 3) you gave to get it work with apache on
ubuntu server 18.04. The first is for nginx.
But I still get that web2py is running on 2.7 version of python?
Le samedi 16 mars 2019 01:46:30 UTC+1, 黄祥 a écrit :
>
> might we know which script that you used ?
>
> check
Sorry this does not work for me.
Did you manage to get a server working with python 3 and apache?
Le samedi 16 mars 2019 12:37:02 UTC+1, 黄祥 a écrit :
>
> think on line 164 and 165 is the culprit, should be
> sudo -u www-data *python3* -c "from gluon.widget import console;
> console();"
> sudo -u
This script works with python 3 but is under nginx:
https://raw.githubusercontent.com/arisobel/web2py_scripts/master/setup-web2py-nginx-p3-uwsgi-ubuntu.sh
Le samedi 16 mars 2019 13:12:06 UTC+1, Mamisoa Andriantafika a écrit :
>
> Sorry this does not work for me.
>
> Did you man
Hi,
I tried to upgrade the easy way from the admin screen but now I get a
ticket that I cannot read. At one point I get:
Requires web2py 2.15.5 or newer
I installed previously for the one step install (Linux).
I tried again but I get a 404 error from:
wget http://web2py.googlecode.com/hg/sc
Hi,
Could you explain to me how this code works?
http://web2py.com/books/default/chapter/29/05/the-views#TABLE--TR--TD
>>> table = [['a', 'b'], ['c', 'd']]
>>> print TABLE(*[TR(*rows) for rows in table])
abcd
I do not completely understand how the loop is created there?
Thank you for your hig
Doest the first star is needed? I think not?
Le dimanche 30 août 2015 19:20:38 UTC+2, Mamisoa Andriantafika a écrit :
>
> Hi,
>
> Could you explain to me how this code works?
>
> http://web2py.com/books/default/chapter/29/05/the-views#TABLE--TR--TD
>
> >>&
Note, technically argument unpacking is not necessary for TABLE nor for
> TR, as both will alternatively accept a list as the first argument. So, the
> code could be changed to:
>
> TABLE([TR(row) for row in table])
>
>
> Anthony
>
> On Sunday, August 30, 2015 at 1:20
n-parameters
>
>
> TABLE(*[TR(*rows) for rows in table])
>
>
> TABLE
> is a function that can takes list argument.
>
> [TR(*rows) for rows in table]
> is a list.
>
>
>
>
>
> 31 Ağustos 2015 Pazartesi 23:33:23 UTC+3 tarihinde Mamisoa Andriantafika
&
Hi,
I have a model like this:
db.define_table('patient',
Field('name','string'),
Field('first_name','string'),
Field('dob','date'),
Field('disease','string', requires=IS_NOT_EMPTY()))
db.define_table('injection',
Field('id_patient', 'reference patient', writable = False, read
()
return count_iiv
db.patient.count_iiv = Field.Virtual('count_iiv',lambda row: get_iiv_number(
row.patient.id))
Le dimanche 18 octobre 2015 19:26:07 UTC+2, Mamisoa Andriantafika a écrit :
>
> Hi,
>
> I have a model like this:
>
> db.define_table('pat
Hi,
Is it possible to GET an answer with a setup restfull service with
parse_as_rest with:
/rest/table_name?id=1
that is equivalent to the working:
/rest/table_name/id/1
?
Morever with more parameters:
/rest/table_name?id=1&name=Toto
Mike
--
Resources:
- http://web2py.com
- http://
Thank you for your answer.
Is there another way to make a rest scaffold service that work with vars in
web2py?
Le mardi 27 octobre 2015 13:56:43 UTC+1, Niphlod a écrit :
>
> parse_as_rest works exclusively with args, not vars.
>
> On Tuesday, October 27, 2015 at 1:20:03 AM UT
Hi,
I switched my current 2.18.5 Web2py installation from python 2 to python 3.
Creating a dummy new application, everything is working.
Using an older application, I get an error in trying to display error logs
from admin:
Billet d'erreur for "admin" Identifiant du Billet
127.0.0.1.2019-10
Hi,
I can't seem to export the db using db.import_from_csv_file in python3. It
is working in python 2.
It seems to be a problem with one of the image or blob field in a table ?
Actually there is only on blob field populated with a b64 image file, but
yet no image file in upload field.
db.defi
It seems to be related with the "blob" type where python 2 accept also
string type while python 3 expect byte type.
When I delete the row which contains the blob with string inside, exporting
function works.
Le dimanche 13 octobre 2019 19:05:58 UTC+2, Mamisoa Andriantafika a écri
I did a fresh reinstallation and it works.
But I cannot point out where is the problem.
Le dimanche 13 octobre 2019 13:18:14 UTC+2, Mamisoa Andriantafika a écrit :
>
> Hi,
>
> I switched my current 2.18.5 Web2py installation from python 2 to python
> 3.
>
> Creating a
Done.
https://github.com/web2py/pydal/issues/598#issue-508723402
Le mercredi 16 octobre 2019 08:45:09 UTC+2, Massimo Di Pierro a écrit :
>
> Can you please open a pydal ticket? I can fix this over the week-end.
>
> On Monday, 14 October 2019 01:54:41 UTC-7, Mamisoa Andriantafika wro
Hi,
I'm working on it at the moment ie Web2py <-> Shibboleth with Apache <->
3rd party provider
Could you give me a hint on how you managed this to work between Web2Py and
Shibboleth?
Mamisoa
Le mardi 22 octobre 2019 13:34:53 UTC+2, Davidiam a écrit :
>
> Thank you. In the meantime we have
48 matches
Mail list logo