hi
i would like to examine the source code of
http://web2py-crm.appspot.com/
but i can not find it on http://web2py.com/appliances/
andrej
--
---
You received this message because you are subscribed to the Google Groups
web2py-users group.
To unsubscribe from this group and stop receiving
hi
i was testing solr and whoosh
now i'm using whoosh because it is python based and i can easily port my
application (no need to intall java, tomcat etc)
newer had any real problems
most of the time i spend figuring out how to use stemmer/lematization (not
for english), but this is not part
hi
i want to show link edit in view just for users in the group editors
how to check that in view?
or is there another way to do that?
and another question: i want new users (signin in) to be part of a certain
(default) group.
how?
andrej
--
i've made app using wizzard
i addes tags
db.define_table('t_tag',
Field('f_game_id', type='reference t_game',
label=T('Game Id')),
Field('f_name', type='string',
label=T('Name')),
auth.signature,
format='%(f_game_id)s',
migrate=settings.migrate)
Hi
Did you implement this?
After trying Whoosh (and finding dificult to implement stemmer/lematization
for my language) i'm looking for another solution.
Is sunburnt the best solution to use solr with python/web2py?
Did you try solrpy?
Andrej
On Friday, July 6, 2012 8:45:21 PM UTC+2, David
hi
Thank you for your explanation. It is really helpful
The address of the chapter in the book is Efficient search by tag and i
choose this approach because i thought that search would be the most
important thing of the application (that was right)
The table tag is similar like in your
should i use
.select(..., cacheable=True)
or
cache.disk('games',lambda:games
what is the difference?
andrej
On Friday, October 19, 2012 1:20:08 PM UTC+2, andrej burja wrote:
hi
Thank you for your explanation. It is really helpful
The address of the chapter in the book is Efficient
hi
system: it is on linode 512, os ubuntu, server apache, database postgresql
my initial design was using list:string, but than i saw example in the book
(Application-Development-Cookbook) and i thought this is better
purpose of that code: user testing reveals, that the best way to search the
possible tags with a single select from
this table. You can also cache that select.
On Thursday, 18 October 2012 02:56:17 UTC-5, andrej burja wrote:
hi
system: it is on linode 512, os ubuntu, server apache, database postgresql
my initial design was using list:string, but than i saw example
hi
i have one page with links (in view1)
{{=A(tag.f_name,_href=URL('games_with_tags_show',vars=dict(tags=tag.f_name
)))}}
and i have search form (in function2/view2):
form = SQLFORM.factory(
Field('tags_ava','list:string',label=T('Tags'),
requires =
hi
i have table games and they have tags
i followed the example in the book and put tags in separate table
now i want to show all games with all tags in the view: game.title,
games.instruction, game.tags
in fuction i have
for game in games:
equipment =[tag.name for tag in
hi
i have page with form and rows.
form = SQLFORM.factory(Field('tags_ava','list:string',label=T('Tags'),requires
= IS_EMPTY_OR(IS_IN_SET(tags_ava_set)),
widget=SQLFORM.widgets.options.widget),
based on selected tag (tag1), i get list of entries (with at
hi
i have SQLFORM with checkboxes (widget).
if i choose one checkbox, type(request.varst.checkbox) is 'string'
and if i choose more than one checkbox, tpye(request.vars.checkbox) is
'list'
why choosing one checkbox does not return 'list'?
form =
with tags (news,
sport, football)
and searching for tags: news, sport
is the result data1 only or data1 and data2
if later, how to search for data with exactly entered tags (omit data with
more tags)
andrej
On Monday, September 24, 2012 5:57:35 PM UTC+2, andrej burja wrote:
hi
it works
hi
there is a nice example of search form
http://www.web2pyslices.com/slice/show/1552/search-form
i would like to do some improvements. At the top there si a search form,
and at the bottom are results. I would like to make results clickable -
clicking on the result opens new function/view
(
data.ALL,
orderby=data.id,
groupby=data.id|data.value,
distinct=True)
On Saturday, 22 September 2012 15:00:07 UTC-5, andrej burja wrote:
the code with problem:
rows = db(data.id==tag.record_id)\
(tag.name.belongs(tags)).select(
data.ALL,
orderby
hi
i would like to use idea in book Application Development Cookbook -
Efficienty search by tag.
there are two functions: 'search_or' and 'search_and'
everything is working fine on sqlite
when i switch to postgres, there seems to be problem with 'groupby'.
i got an error
class
the code with problem:
rows = db(data.id==tag.record_id)\
(tag.name.belongs(tags)).select(
data.ALL,
orderby=data.id,
groupby=data.id,
distinct=True)
On Saturday, September 22, 2012 10:26:27 AM UTC+2, andrej burja wrote:
hi
i would like to use idea in book
hi
is anybody using pandas with web2py
i think i can do
equipment = db().select.as_dict()
df = DataFrame(equipment)
but how to display pandas DataFrame object in web2py view?
or how to convert in to something i can display in view?
andrej
--
with this statement i get list of all the tags
tags = db().select(db.t_tag.f_name,distinct=True)
t_tag has only reference - value
what is the fastest way to count number of appearances for every tag
i would like to dipslay
tag (number of objects wit that tag)
andrej
--
what if i want newrows to contain only duplicates?
i want to display only rows which are in rows1 AND rows2
andrej
On Tuesday, June 5, 2012 7:22:11 PM UTC+2, Anthony wrote:
I think you can do:
myrows.records.append(myrow)
Note, I don't think this is part of the documented API, so probably
i think there are some problems in chapter The database abstraction
layerhttp://www.web2py.com/books/default/chapter/29/06 after
belongs
anrej
On Saturday, September 1, 2012 7:00:49 PM UTC+2, Massimo Di Pierro wrote:
The web2py book app has been rewritten
http://www.web2py.com/book
in the book Application development cookbock
there is plugin_detec_mobile (page 324)
and there is a line,
if switch_view:
view = '%(controller)s/%(function)s.mobile.%(extension)s' %
request
if os.path.exists(os.path.join(request.folder, 'views',view)):
response.view = view
there
hi
i installed web2py with script found here. currently i have ubuntu 10.04.
has anybody upgraded ubuntu from 10.04 to 12.04.1? are there any problems
(regarding web2py or postgres 8.4)? should i upgrade or wait some time?
andrej
--
thank you
this is working example
controller:
import os, tempfile
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
import cStringIO
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
def draw():
x = np.array([10, 8, 13, 9, 11, 14, 6, 4, 12, 7, 5])
this works
controller:
def image():
return dict(a=IMG(_src=URL('myimage'+'.png')))
view:
{{extend 'layout.html'}}
h1This is the graph/image.html template/h1
{{=a}}
but this doesn't
controller:
def image():
return myimage()
view:
{{extend 'layout.html'}}
h1This is the graph/slika1.html
i've installed the latest verson of matplotlib (from source, also libpng
and freetype)
now matplotlib is working
but using MATLAB a lot, i have one question: is it possible to
usematplotlib.pyplot instead of matplotlib api (matplotlib.figure) and not
saving the file (sendign directly to view)?
controller/myimage
does not work for me, it displays content of png file
controller/myimage.png
does display html with included image
it looks like the view has no effect
so i tried
{{=IMG(_src=URL('myimage.png'))}}
it displays content of png file, overriding everythin else in the view
any
controller:
def myimage():
import cStringIO
fig=Figure()
canvas=FigureCanvas(fig)
stream=cStringIO.StringIO()
canvas.print_png(stream)
return stream.getvalue()
view:
{{extend 'layout.html'}}
h1This is the graph/myimage.html template/h1
{{=IMG(_src=URL('myimage'))}}
probably problem with mod_wsgi
any solutions?
andrej
the line
#os.environ['MPLCONfigureDIR'] = tempfile.mkdtemp()
should be
os.environ['MPLCONFIGDIR'] = tempfile.mkdtemp()
but now there is this error:
*
Traceback (most recent call last):
File /home/www-data/web2py/gluon/restricted.py, line 194, in restricted
using matplotlib plugin there
http://web2py.com/plugins/static/web2py.plugin.matplotlib.w2p
i get error
RuntimeError: Failed to create /var/www/.matplotlib; consider setting
MPLCONFIGDIR to a writable directory for matplotlib configuration data
(it is on ubuntu+apache)
(how) should i change the
with
row[sum]
it doesn't work
type 'exceptions.KeyError'('built-in function sum')
Actually, the above will only work if the controller returns 'sum' in the
dictionary -- otherwise it will be undefined in the view.
what shoul i change in the controller?
working example
controller:
def person():
sum = db.t_payement.f_value.sum()
rows=
db().select(db.t_person.f_name,db.t_person.f_surname,db.t_person.f_city,
sum, groupby=db.t_person.id,
left=db.t_payement.on(db.t_person.id==db.t_payement.f_person))
return dict(rows=rows, sum=sum)
controller:
def person():
sum = db.t_payement.f_value.sum()
rows=
db().select(db.t_person.f_name,db.t_person.f_surname,db.t_person.f_city,
sum, groupby=db.t_person.id,
left=db.t_payement.on(db.t_person.id==db.t_payement.f_person))
return dict(rows=rows)
view:
this one works
TD(row['SUM(t_payement.f_value)'])
and also this
TD(row._extra['SUM(t_payement.f_value)'])
requires = IS_IN_DB(db,'tag.id',db.tag._
format,multiple=True)
displays format of tag in dropdown while editing
how to display format in view. doing
row.tag
displays id
is it different if format of tag is lambda function?
andrej
in controler i do join and sum
the result si rows object
in response._vars the sum is displayed in
SUM(t_table.f_field)
what is the syntax to display that in view?
andrej
there are two ways:
db.define_table('quantity',
Field('value','integer'))
db.define_table('item',
Field('unit_price','double'),
Field('quantity',db.quantity),
Field('total_price',
compute=lambda r:
r['unit_price']*db.quantity[r.quantity].value))
or
what is the syntax of compute, if i use reference in the table definition
db.define_table('item',
Field
http://www.web2py.com/book/default/docstring/Field('unit_price','double'),
Field
http://www.web2py.com/book/default/docstring/Field('quantity',db.quantity),
Field
hi
how could i add a sum in the linked table?
i have person, linked table payments. Opening the payments table from person
table, displaying only payments from that person, i would like to display
the sum for that person. How can i do that?
and how to change the label on button 't_payments'?
hi
i have
def person_manage():
columns =
['t_person.id','t_person.f_name','t_oseba.f_surname','t_oseba.f_email']
linked_tables = ['t_message']
form =
SQLFORM.smartgrid(db.t_oseba,linked_tables=linked_tables,columns=columns,onupdate=auth.archive)
return locals()
without
hi
i want to insert a date, bust just a day and a mont, without a year
is that possible?
andrej
why is the first part
def keywords(record):
return list(set(x.lower() for re.compile('\w
+').findall(record.content or '')))
raising an error in syntax
andrej
hi
crud.search returns form and rows
1. is it possible to set that rows object (result of search) contains all
data from table, not just fields, that are checked in search form
2. after doing search, is it possible to display just a result (rows),
without form
so the result of searching for
hi
is it possible to create a site with a switch like chosing a language
(http://vimeo.com/7520812)
but instead of language i would like to select which version of a view i
woul like to see: desktop or mobile
so the first line in i view would be:
extend layout.html
or
extend
in model i have
T.force('sl-si')
and
db.course.date.requires = IS_DATE(T('%Y-%m-%d'))
in language fiel i have
%Y-%m-%d
%d %m %y
in SQLFORM (od crud) and also the calendar widget it si ok
but how can i display date in right format in view where i have
for row in
TD(row.date)
andrej
it works, thank you
but it is hardcoded
this is better
TD(row.date.strftime(str(T('%Y-%m-%d')))
andrej
hi
i'm running 1.97.1 now.
the problem in table racun
SyntaxError: Field delete_this_record does not belong to the table
was gone in previosu version
but the problem with table with images (upload filed) is still here
the model
db.define_table('izobrazevanje',
i have changed
form=crud.update(db.izobrazevanje,request.args(0))
to
form=SQLFORM(db.izobrazevanje,request.args(0),deletable=True,
upload=URLhttp://web2py.com/book/default/docstring/URL
('download'))
now it is ok
andrej
hi
on win7 i have web2py in dropbox folder, so i can work on applications from
two computers (and to have a backup)
but now i'm getting this error quite often:
IOError: [Errno 22] invalid mode ('w') or filename:
'C:..\\Dropbox\\...\\databases\\c8b669d15150d7109e5f7_izobrazevanje.table'
Could
hi
i installed web2py with a script setup-web2py-ubuntu.sh on ubuntu (vps)
in the script, there is installation of reportlab
on windows machine i have put the reportlab in site-packages folder and i
have added some fonts
when i move my application to vps ubuntu server and doing
from
i model i have
Field('datum_start','date',label='začetek'),
in controller i want to convert datum_start to datetime object (to
manipulate it with python)
how can i do that?
andrej
i'm sorry. my mistake
here is the whole thing:
in db.py
+
db.define_table('racun',
Field('stevilka_racuna','integer',label='številka računa'),
Field('datum_racuna','date',label='datum računa'),
vars:
datum_dobave:
2011-04-03
datum_racuna:
2011-04-03
id:
1
opomba:
placnik:
2
sklic:
1
sporocilo_kupcu:
stevilka_racuna:
1
zapadlost:
get_vars is empty
After upgrading to 1.95.1 (on windows, from source) get error:
Traceback (most recent call last):
File ...\gluon\restricted.py, line 181, in restricted
exec ccode in environment
File .../controllers/racun.py
http://127.0.0.1:8000/admin/default/edit/test7/controllers/racun.py, line 65,
it is not (in 2011-05-05)
but there is one difference: even when deletable is enabled, i first get the
error (when there is an upload field)
Field logo_highres__delete does not belong to the table
andrej
in meta-menu page in plugin-wiki i define menu link as
Person page:person
and this leads to url
application/plugin_wiki/page/person
what if i want to add link to
application/person
(not inside plugin_wiki)
what is the syntax, if i don't want to include
in IS_IMAGE i can use
extensions: iterable containing allowed image file extensions in lowercase
in IS_UPLOAD_FILENAMe i can use
extension: extension (after dot) regex
is there a special reason why there is not an option to use iterable in
IS_UPLOAD_FILENAME
i want to chek if the file is svg
hi
how can i include a svg (or maby even svgz) file in view?
can i do something similar as with image
img src={{=URL('download', args=row.table.logo_image)}} /
i tried this
object type=image/svg+xml
data={{=URL('download', args=row.table.logo_svg)}}
span//object
but it doesn't
nice.
as i have read, {{extends should be the first line in the view
so it is not possible to do this?
{{if condition:}}
{{extends 'layout1.html'}}
{{else:}}
{{extends 'layout2.html'}}
...
andrej
hi
pyftpdf (included in web2py) does not have unicode support
does anybody know are there some unicode problems in reportlab too?
maby font problems?
i would like to see code example for reportlab on gae (since the
example in the book does not work :)
andrej
On Apr 5, 3:15 pm, Massimo Di
hi
as i understand on GAE many to many relationships should be done by
list:reference. i have two questions:
- having table with 1000 persons and another table with 100 courses (each
person can attend multiple courses) what is better: putting list:reference
in first table (person) or second
Hi
I have some experience in RDB system (mysql, access), I have done some work
in zope (object oriented database), and now I would like to try some things
in nosql. So I have some questions
1. where can I find some useful resource for nosql
2. what can I do in design of my
maby it should be like WebGrid :)
On Nov 13, 7:14 am, mdipierro mdipie...@cs.depaul.edu wrote:
Probably yes. I am not happy with crud.select. I think it should do
pagination for example too and have sortable columns and perhaps have
a an option to include crud.select().
Massimo
On Nov 12,
tank you
that solves my problem
andrej
On 10 nov., 21:00, mdipierro mdipie...@cs.depaul.edu wrote:
db.define.table('advanced'
Field('name1',requires=IS_IN_DB(db,'basic.name1')),
On Nov 10, 1:49 pm, andrej burja andrej.bu...@gmail.com wrote:
hi
is it possible to create
i'm using WebGrid for Web2py
making a filed not readable (and writable) doesn't show them in edit
or view
but in grid, the fields are shown
i know i can hide them by defining fields
is this problem connected to that bug?
On 22 okt., 15:07, Richard Vézina ml.richard.vez...@gmail.com wrote:
;-)
thank you
it is too obvious to see that i made replacement of the validators :)
On Nov 4, 10:24 am, DenesL denes1...@yahoo.ca wrote:
On Nov 3, 3:52 pm, andrej burja andrej.bu...@gmail.com wrote:
hi
why is order of validators important?
i have
db.tecaj.voditelj.requires=IS_NOT_EMPTY
does not work, still getting id and no name
On Nov 4, 3:59 pm, mdipierro mdipie...@cs.depaul.edu wrote:
do this:
db.define.table('basic'
Field('name1')
...,format='%(name1)s')
db.define.table('advanced'
Field('name2',db.basic)
hi
is it possible to create a text field in table 'advandced' containing
'name1' (no reference, just characters)
andrej
On 10 nov., 15:22, mdipierro mdipie...@cs.depaul.edu wrote:
ERRATA:
do this:
db.define.table('basic'
Field('name1')
hi
i have
db.define.table('basic'
Field('name1')
...)
db.define.table('advanced'
Field('name2',db.basic)
...)
db.advanced.name.requires=IS_IN_DB(db,'basic.id','%(name1)s')
db.define.table('data'
hi
why is order of validators important?
i have
db.tecaj.voditelj.requires=IS_NOT_EMPTY()
db.tecaj.voditelj.requires=IS_IN_DB(db,'person.id','%(name)s')
why does putting the IS_NOT_EMPTY() at the end doesn't produce
dropdown list?
do i need the IS_NOT_EMPTY() if i have IS_IN_DB validator?
hi
i would like to store the generated pdf directly in the database on
gae
andrej
On Oct 5, 4:03 am, Mariano Reingart reing...@gmail.com wrote:
On Mon, Oct 4, 2010 at 12:18 PM, andrej burja andrej.bu...@gmail.com wrote:
is it possible to use pdf made from DTP application (like
indesign
hi
i'm running web2py, latest version, on windows 7 from source (on
python 2.6). i'm using firefox for file editing.
editing files in admin, i can save changes with button only once,
after that the button is dimmed
i can save with ctrl + s
the situation is the same in chrome
is this normal?
hi
looking at pyfpdf sample report
can samebody explain sytax
body = TBODY(*rows)
andrej
:07, andrej burja andrej.bu...@gmail.com escreveu:
hi
in model.py i have
db.define_table('person',
Field('name'),
format='%(name)s')
in controllers/default.py i have
def ustvari_oseba():
form=crud.create(db.person)
persons=crud.select(db.person)
return dict(form
hi
in the section about crud
should there be
def data(): return dict(form=crud())
def create_tablename():
def update_tablename():
instead of
def data: return dict(form=crud())
def create_tablename:
def update_tablename:
and in
# assuming db.define_table('person', Field('name'))
def people():
hi
in model.py i have
db.define_table('person',
Field('name'),
format='%(name)s')
in controllers/default.py i have
def ustvari_oseba():
form=crud.create(db.person)
persons=crud.select(db.person)
return dict(form=form,persons=persons)
form is ok, but persons is not
how or where should i define format representation for records
if i put it in db.define_table:
db.define_table('oseba', Field('ime'), Field('priimek'),
Field('naslov'), Field('email',label='Elektronski naslov'),
format='%(ime)s %(priimek)s')
there is a id reference in SQLTABLE (not ime priimek)
is it possible to use pdf made from DTP application (like
indesign,scribus) and merge it to new pdf (on GAE) - with pyfpdf or
any other tool
like having a template (pdf file) and adding name, surname etc.
is it possible on GAE to directly store new file in database?
109 000 from Slovenia
On 28 mar., 15:48, Tito Garrido titogarr...@gmail.com wrote:
*108.000 from Brazil*
On Sun, Mar 28, 2010 at 10:13 AM, Mengu whalb...@gmail.com wrote:
109K from Turkey.
On 28 Mart, 15:14, Alfonso de la Guarda alfons...@gmail.com wrote:
Hello,
110,000
from
82 matches
Mail list logo