If you use a simple editor only, it is similar as the work with web2py
integrated environment. You can just create and edit python files.
Of course the suitable editor must be special for Python writting: It must
at least convert the Tab into 4 spaces. And work with utf-8.
If you want more, then
I just confirm that this works.
1. (Backup and) delele database/*.table files
2. Into db=DAL(..) command add db=DAL(..., fake_migrate_all=True), then run
once: app/appadmin/ or some other page
3. Remove fake_migrate_all=..
Dne pátek 8. září 2017 12:24:05 UTC+2 Leonel Câmara napsal(a):
>
> Your
I have a form:
SQLFORM.factory(*field_list)
First item in field list is a foreign key to some table.
I see the selected value and all possible selectable values great.
Example: drink : watter from (watter, beer, wine)
However: I try make the first field readonly.
Now I see it readonly, but with v
2.15.3-2017.08.07
I had same here, with SQLite too.
I confirm it can be solved so:
1) rename databases/ to databases_corrupted/
2) create empty folder databases/
3) navigate to appadmin or main page -> database is now empty
4) copy databases_corrupted/sqlite.db back to databases/sqlite.db
or so:
Probably:
db(db.table.id == 1).select(*selects).first()
which in Python will unpack the parameters from an iterable (tuple here).
Jinak ... zdravim, a tesi me, ze nekdo dela pokusy s web2py.
Budes-li potrebovat nejakou pomoc nebo o tom chtit nekdy dat rec, kontakt
je: zvol...@seznam.cz, 732457966
or remove the pg8000 from Web2py release completely
I made yesterday Issues for updating pg8000 in Web2py release. I still
think that this would be a good step.
Dne čtvrtek 17. srpna 2017 21:15:25 UTC+2 Dave S napsal(a):
>
>
>
> On Thursday, August 17, 2017 at 4:59:10 AM UTC-7, Mire
Other advantage (for me) is that the database access with the current
version of pg8000 seems to be faster (- 30% ?).
Dne čtvrtek 17. srpna 2017 14:33:51 UTC+2 Mirek Zvolský napsal(a):
>
> As long the contrib/pg8000 version is old,
> it is good idea to install the current version: pi
x='',
id_prefix='markmin_',
**kwargs):
self.text = to_bytes(text + '') # hotfix 2.13.5: + ''
Dne čtvrtek 17. srpna 2017 15:44:07 UTC+2 Mirek Zvolský napsal(a):
>
> For me today, with 2.15.3:
>
> 1)
For me:
1)
I had no file applications/admin/private/hosts.deny -> when manually
created, admin works.
2)
This doesn't work for me in templates (was Ok in version from 2016):
{{=MARKMIN(T("**something bold** something more"))}}
This works:
{{=T("**something** something")}}
Error for the 1st case
As long the contrib/pg8000 version is old,
it is good idea to install the current version: pip install pg8000
Errors from old driver are like (at least pg 9.6, long running tasks):
OperationalError, Broken Pipe,...
I have created issues:
https://github.com/web2py/web2py/issues/1742
https://githu
It's hard to say something, because heaven knows what does `codex2020`
> look like (are there any outgoing db-connections/url-requests/sub
> processes) and what is the DB where the scheduler is mounted (Postgres?).
> Exclusion method is universal - just make workers to dig some
I have a task about 15 minutes long which run great on localhost with
command
python web2py.py -a "q" -K codex2020 -X
In production, Debian9+systemd+nginx+uwsgi I have
- emperor.uwsgi.service for web server,
- web2py-scheduler.service for tasks, where
ExecStart=/usr/bin/python /home/www-data/web2
Hi Zbigniew and Niphlod.
I have same/similar traceback when the task will timeout, in my case in 2h:
File "/home/www-data/web2py/gluon/scheduler.py", line 720, in
signal.signal(signal.SIGTERM, lambda signum, stack_frame: sys.exit(1))
SystemExit: 1
scheduler_run.stop_time is scheduler.start_
This is not so much complex if you split it into 2 steps.
1) Be familiar with the welcome/ application - this is scaffold application
in standard web2py distribution.
- Models are called always and create db (database object and sql database
structures) + auth (authorization object) + menu.
- C
1) pip install sparkpost
2) I have this inside my private/appconfig.ini:
; smtp address and credentials
[smtp]
server = smtp.sparkpostmail.com:587
sender = mojekniho...@mojeknihovna.eu
login = SMTP_Injection:4dxxx92
3) I have the file modules/mail_send.py with mail_se
I have tested this and for me it returns the emails properly.
Check if len(rows)==4
If NO, you are connected to a different database or so,
if YES, there is some setting to make/skip table sub-objects. So try both:
row.email, row.auth_user.email
Dne pátek 26. května 2017 13:08:39 UTC+2 Arth
This has nothing with Web2py but with Python.
Try this:
>>> a = 5
>>> def f():
if False:
a = 3
return a
>>> f()
UnboundLocalError: local variable 'a' referenced before assignment
And this is exactly what you have in vote_callback() with variable books.
Python can with variables from outer scope w
I have found it, in book chapter 7.
Here is the trick:
form = SQLFORM(db.person, request.args(0), upload=URL('download')).process()
On Monday, 20 February 2017 14:00:47 UTC+1, Najtsirk wrote:
>
> Hi,
>
> i have the following problem.
>
> *Model:*
> db.define_table('person',
> Field('name
If you think just in the edition where you have an already saved image:
CONTROLLER
def person():
form = SQLFORM(db.person, request.args(0)).process()
person = db.person(request.args(0))
return dict(form=form, person=person)
VIEW
{{=form.custom.begin}}
{{=form.custom.widget.name}}
Do you think
- when adding new record, immediately after user will choose the file from
disk?
You can (using Javascript) catch the onchange event of the file imput and
load the picture using window.FileReader into some element.
Something like here:
http://stackoverflow.com/questions/4459379/pre
(strings, key=collator.getSortKey)
On Friday, 10 February 2017 18:08:58 UTC+1, Mirek Zvolský wrote:
>
> ... or to any other special order.
>
> For me was creazy that I was not able to sort items (names) in IS_IN_DB
> lists alphabetically.
> IS_IN_DB has lot of undocumented para
10:42:56 UTC+1, Mirek Zvolský wrote:
>
> Thanks, Hiphlod.
> Does this mean that
> 1) I cannot use locale module at all,
> 2) I cannot switch more different locales/languages and I have to import
> and set locales at some module "root" level,
> 3) I cannot switch more diff
ction in place of options_sorter() (or, if you
> want an alternative options_sorter in all cases, you could just monkey
> patch it in gluon.validators).
>
> Anthony
>
> On Friday, February 10, 2017 at 12:08:58 PM UTC-5, Mirek Zvolský wrote:
>>
>> ... or to any other sp
Thanks, Hiphlod.
Does this mean that
1) I cannot use locale module at all,
2) I cannot switch more different locales/languages and I have to import
and set locales at modules "root" level,
3) I cannot switch more different locales/languages, but I can set them in
model (like I do) ?
I think 3) i
... or to any other special order.
For me was creazy that I was not able to sort items (names) in IS_IN_DB
lists alphabetically.
IS_IN_DB has lot of undocumented questions but I think nothing can help.
Of course when running from Postgres, you will receive records with proper
locale order.
Howe
gth
> direction to improve chance your work didn't get lost on the list as it
> happen sometimes.
>
> :)
>
> Richard
>
>
>
> On Thu, Dec 8, 2016 at 10:29 AM, Mirek Zvolský > wrote:
>
>> Hi Richard.
>>
>> I'm beginner with Linux (upgra
atetime.datetime.now(),
stop_time=None,
timeout=2147483647,
prevent_drift=False,
period=20,
immediate=False,
repeats=0
)
return 'Task idx was added.'
On Thursday,
> that you submit your improvements as a PR over github and then point other
> users over you fork or the PR pending acceptation our your commit once PR
> accepted...
>
> Thanks for your help
>
> Richard
>
> On Thu, Dec 8, 2016 at 7:27 AM, Mirek Zvolský > wrote:
>
>>
The link is no longer working.
Here is the script. This version worked for me:
#!/bin/bash
echo 'setup-web2py-nginx-uwsgi-ubuntu-precise.sh'
echo 'Requires Ubuntu > 12.04 or Debian >= 8 and installs Nginx + uWSGI +
Web2py'
# Check if user has root privileges
if [[ $EUID -ne 0 ]]; then
echo "Yo
One thing more
In my opinion the service is controlled without ".service" in name.
systemctl start emperor.uwsgi(if
/etc/systemd/system/emperor.uwsgi.service used)
systemctl start uwsgi(if the name is /etc/systemd/system/uwsgi.service
as (maybe) in your 'digitalocean' article)
And here is the version of script that I have used (I hope so) to install
on my machine.
So if you decide use the installation script
setup-web2py-nginx-uwsgi-ubuntu.sh
maybe you could try the version from current trunk github.com/web2py/web2py
and as second one you can try this version:
#!/bin
And this is the third file:
-rw-r--r-- 1 root root /etc/systemd/system/emperor.uwsgi.service
[Unit]
Description = uWSGI Emperor
After = syslog.target
[Service]
ExecStart = /usr/local/bin/uwsgi --ini /etc/uwsgi/web2py.ini
RuntimeDirectory = uwsgi
Restart = always
KillSignal = SIGQUIT
Type = notif
On my working machine (Debian 8 Testing (systemd), nginx)
I have installed with the script
https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
but there was some problem or some missing code which I have found
somewhere here in user group.
I am not sure if las
{=form.custom.widget.password}}
> {{form.custom.widget.remember_me['_checked']= 'true'}}
>
> {{=form.custom.widget.remember_me}}
> {{form.custom.submit['_class']= 'w3-btn w3-center w3-btn w3-xlarge
> w3-blue'}}
> {{form.custom.submit['_id']= 'valide
not web2py, but looks interesting.
http://www.w3schools.com/w3css/default.asp
On mobile pages load instantly. In oposite to bootstrap3.
Does somebody use it ?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://c
ere I see lot of new work!, thanks).
On Monday, 7 November 2016 18:28:22 UTC+1, Mirek Zvolský wrote:
>
> I use Debian (testing), Postgres 9.4,
> and Web2py 2.14.6 (with current trunk is problem the same)
>
> I use such command (assigned to an alias) for long time to start
orker_st... ^ HINT: You will need to rewrite or cast
the expression.
Debian 8 Jessie Testing, Postgres 9.4, python-psycopg2/testing,now 2.6.2-1
amd64 (I hope Web2py uses this one)
On Monday, 7 November 2016 18:28:22 UTC+1, Mirek Zvolský wrote:
>
> I use Debian (testing), Postgres 9.4,
"/home/mirek/mz/web2py/gluon/restricted.py", line 216, in restricted
exec(ccode, environment)
File "", line 113, in
File "/home/mirek/mz/web2py/gluon/html.py", line 2802, in __init__
self.text = to_bytes(text)
File "/home/mirek/mz/web2py/gluon/_compat.py
I use Debian (testing), Postgres 9.4,
and Web2py 2.14.6 (with current trunk is problem the same)
I use such command (assigned to an alias) for long time to start my
application
python web2py.py -K codex2020 -X $@
Today I received strange behaviour, errors like
web2py.scheduler TICKER: error assi
Maybe the answer is about the Javascript support. Just for Python the
Community version works great. (But I am Linux user.)
On Sunday, 30 October 2016 03:31:59 UTC+1, Nikos Panagogiannopoulos wrote:
>
>
> Will the community version of PyCharm be capable to full service me or i
> do have to go
I need run a script which for marked records in one table creates
"indexing" or "helpers" records in another table.
This script should:
- switch this activity and sleep(10) /should sleep after it will not find
any marked record/
- run always
- run in 1 instance only /to avoid indexing of same rec
I think in the alphabetically first model I will use
if request.controller == '':
response.models_to_run = ...
On Wednesday, 19 October 2016 08:52:08 UTC+2, Mirek Zvolský wrote:
>
> Hi,
> I am trying implement fine-uploader for upload files (used in import from
> oth
Great !!!
Thanks.
On Wednesday, 19 October 2016 11:26:18 UTC+2, Nico de Groot wrote:
>
> You could use conditional models. Just make an empty folder in /models
> with the name of a (new) controller. Put the functions that don't need any
> models inside that controller.
>
> See
> http://www.we
Upload size:
In Javascript it is possible read the height/width/size of the image and if
they are to large, then you can resize them.
No special library is needed. This can be done using html5 canvas.
Here is my code.
The first line of code is from work with js cropper
https://fengyuanchen.githu
Hi,
I am trying implement fine-uploader for upload files (used in import from
other software).
Fine-uploader generates lot of ajax calls with each chunk of each imported
file.
These Ajax calls just need read and save the chunk (or join chunks with the
last call).
They don't need any model.
I h
day, August 25, 2016 at 12:51:04 PM UTC+2, Mirek Zvolský wrote:
>>
>> I heard much about timeout of web request (like 60s) and about the need
>> to use scheduler if the action is slow.
>> But I'am not sure about large file uploads.
>>
>> Is the file send to
btw:
your tables aren't large, but small.
This will run well with SQLite on every hosting.
Example:
- Google App Engine NoSQL for free (with list:string fields for modificator)
- Forpsi virtual server 20G SSD with Postgres (or just SQLite)
http://www.forpsi.com/virtual/?lang=en-US
for 1.2 EUR/m
With pydal (ie. db=DAL()) you can get the records in 2 queries:
event = db(db.events.id == wish_event_id).select()
and event_modificators = db(db.modificator.events_id
== wish_event_id).select()
then convert to the list:
event_modificators = [row for row in event_modificators]# item is whole
Hi,
Web2py (I think) at this time has no pip/PyPI packaging and no
Debian/Ubuntu packaging. All previous attempts are obsolete.
In Debian apt (Jessie testing) apt I see python-web2py version 2.12.3-1.
But we have 2.14.6 at web2py.com, Download.
I think you should switch to current version, using
{{book_title_value = 'My book title'}}
> {{pass}}
> {{=INPUT(_type='text', _name='book_title', _id='book_title', _value=
> book_title_value)}}
>
> Il giorno mercoledì 24 agosto 2016 17:20:20 UTC+2, Mirek Zvolský ha
> scritto:
>>
&
I heard much about timeout of web request (like 60s) and about the need to
use scheduler if the action is slow.
But I'am not sure about large file uploads.
Is the file send to the server during http request or when I ask .read()
(or .value) in the controller? Should I take care about time of the
form.vars.book_title ? (book, chapter 7)
Dne úterý 23. srpna 2016 13:47:34 UTC+2 Gael Princivalle napsal(a):
>
> Hello.
>
> In a custom form when the user submit the form with errors I need to
> reload all user inputs and set the input value.
>
> For example here is an input:
> {{=INPUT(_type=
What is it "an online database"?
If it has some API, call that API.
If it is database accessible via TCP/IP, use DAL() with proper connection
string.
Dne sobota 20. srpna 2016 23:11:23 UTC+2 karthik naidu napsal(a):
>
> i'm planning to do a gps tracker and i need to get information from an
In Web2py you can set this in Field(), in db model or in SQLFORM.factory,
via requires=.
Something like:
requires=[IS_NOT_EMPTY_(), IS_DATETIME(format='%d.%m.%Y %H:%M')]
And you can use T('%d.%m.%Y %H:%M') and translate format for different
locales.
Dne neděle 21. srpna 2016 15:28:18 UTC+2
Probably something with foreign key integrity (cascade, restrict, ...)
because after deleting of records in other tables it works.
However, how to understand such error tickets?
Dne pondělí 22. srpna 2016 13:31:50 UTC+2 Mirek Zvolský napsal(a):
>
> I am trying delete all records with ap
I am trying delete all records with appadmin.
Error message is not very descriptive.
Any idea?
Traceback (most recent call last):
File "/home/www-data/web2py/gluon/main.py", line 464, in wsgibase
session._try_store_in_db(request, response)
File "/home/www-data/web2py/gluon/globals.py", li
path)
File "/usr/lib/python2.7/tarfile.py", line 2329, in utime
os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime))
OverflowError: Python int too large to convert to C long
Dne úterý 9. srpna 2016 14:40:03 UTC+2 Mirek Zvolský napsal(a):
>
> Yes, .w2p.
> It is my plugin,
e testing database is used...
>
> Richard
>
> On Tue, Jul 26, 2016 at 6:24 AM, Mirek Zvolský > wrote:
>
>> Finally I realized it using
>>
>> session.testing = False / True
>>
>> Because I think the resulting plugin_splinter is interesting (for
>> s
and not an app?
> If it is an app you need to upload it from the form on the right of the
> main site page.
>
> On Thursday, 4 August 2016 06:23:35 UTC-5, Mirek Zvolský wrote:
>>
>> I have the .w2p file on disk.
>> I choose it in Admin interface, edit application, plug
Or maybe all is properly installed but the service control command is
unknown.
So you can just try the systemctl command from bottom of (patched) script:
sudo systemctl restart nginx
sudo systemctl restart emperor.uwsgi
Dne úterý 9. srpna 2016 14:03:18 UTC+2 Mirek Zvolský napsal(a):
>
&
If you have lot of time, you can test if this script works:
https://github.com/zvolsky/web2py/blob/zvolsky_rejected/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
Here I try use systemctl instead of start.
Dne pondělí 8. srpna 2016 18:39:51 UTC+2 mweissen napsal(a):
>
> I have tried to setup a
I have the .w2p file on disk.
I choose it in Admin interface, edit application, plugins, upload.
Then only first file from the plugin is properly unpacked,
other files aren't.
Then the error will flash: "App does not exist or you are not authorized"
I am trying to debug it and see that
redirect t
If I use
URL('action', args=("a#b", "a:b"))
I will receive
request.args == ['a_b', 'a_b']
So I need to use something like base64.b32encode() for each one item from
args.
Probably this is "by design" behaviour,
but I'm curious why is it so?
urllib.quote / .unqoute returns the original value a#
Finally I realized it using
session.testing = False / True
Because I think the resulting plugin_splinter is interesting (for somebody),
I hope I will publish it and write more later.
Dne pondělí 18. července 2016 11:55:57 UTC+2 Mirek Zvolský napsal(a):
>
> 1.
>
> I use postg
x27;smtp.login')
Dne pondělí 25. července 2016 15:07:47 UTC+2 Mirek Zvolský napsal(a):
>
> Try the port :587 setting.
> My settings are:
> [smtp]
> server = smtp.sparkpostmail.com:587
> sender = x...@.eu
> login = SMTP_Injection:4d..92
>
>
>
>
> Dne
Try the port :587 setting.
My settings are:
[smtp]
server = smtp.sparkpostmail.com:587
sender = mojekniho...@mojeknihovna.eu
login = SMTP_Injection:4d..92
Dne neděle 24. července 2016 16:52:17 UTC+2 icodk napsal(a):
>
> I try to use sparkpost with web2py. However I get the following error:
> WA
... ? --thanks in
advance
Dne pondělí 18. července 2016 11:55:57 UTC+2 Mirek Zvolský napsal(a):
>
> 1.
>
> I use postgres database dbapp
> I am trying to make splinter tests and want to run them over the 2nd
> database dbapp_tests.
>
> When I switch to the testing
I use postgres database dbapp
I am trying to make splinter tests and want to run them over the 2nd
database dbapp_tests.
First attempt I made with starting Web2py on different port, :8001,
then I detect the port from request object
and I create db=
choosing from 2 different appconfig.ini settings
You need form and its submitting.
You can use Web2py form support, see web2py.com/book chapter 7:
FORM,
or SQLFORM.factory (you have to save yourselves the input value after
the form validation from forms.vars into db database)
or SQLFORM (this will save the input value automatically)
Bo
Massimo, this is great !
>From your second example I think, it could work for serial m:1 joins too.
Example:
invoice_item >- product >- product_group
If I want list invoice_items with product.name + with product_group.name
Realy is this now possible?
Dne úterý 5. července 2016 20:20:06 UTC+2
I think format should be
- on python server side in requires=IS_DATETIME()
- on javascript client side in web2py_ajax.html
If you still have the problem, can you describe more:
formatting code in python and javascript + what exactly works wrong?
Dne sobota 18. června 2016 7:02:12 UTC+2 St
I cannot see/download screen shots, is it just my problem?
Dne neděle 5. června 2016 0:06:15 UTC+2 黄祥 napsal(a):
>
> what i want to achieve is showing a map in each row of SQLFORM.smartgrid
> links (looks like in the attached file)
> thanks massimo, tried your suggestion, but got the same resul
I think if you use the thread instance of db, i.e.
current.db
or
db tnasferred through parameter
i.e. db which was created in model,
then you don't need commit because such db will be commited with success of
the model-controller-view code.
But if db is instantiated in the module, outside from We
now merged in trunk
Dne úterý 7. června 2016 15:03:42 UTC+2 Mirek Zvolský napsal(a):
>
> It really looks like this is broken with some new commit.
>
> In 2.14.5 I have - gluon/tools.py 6476-6478
> gid = group.id if group else db.auth_group.insert(
>
It really looks like this is broken with some new commit.
In 2.14.5 I have - gluon/tools.py 6476-6478
gid = group.id if group else db.auth_group.insert(
role='wiki_editor')
auth.add_membership(gid)
In trunk (and probably 2.14.6) - gluon/tools.py 6506-6510
Thank you, Anthony!
For me was important to be sure that I make no other mistake and proper way
to fix it is with delayed setting of represent=..
Based on your answer, this works excellent for me:
db.place.place_id.represent = lambda id, row: id and id.place or ""
(handled for None + different pa
I have self refenced table for places (locations), ie. hierarchical
structure of places is possible.
db.define_table('place',
Field('place', 'string'),
Field('place_id', 'reference place'),
format='%(place)s'
)
In Web2py grid for the parent place (place_id)
I see:
I don't understand where is the problem? Can you describe it again or
better?
Web2py adds id field into all tables as primary key,
field of type 'reference tablename' or db.tablename became foreign keys.
This is standard behaviour.
If you want/need to modify this behaviour, you should read about
.
Dne pondělí 30. května 2016 12:15:18 UTC+2 Mirek Zvolský napsal(a):
>
> Please help
>
> Debian Jessie, postgres, web2py-scheduler
>
> How can I prevent following crash - inactive scheduler?
> Or how can I be sure that the scheduler is running and restart it if
> need
Please help
Debian Jessie, postgres, web2py-scheduler
How can I prevent following crash - inactive scheduler?
Or how can I be sure that the scheduler is running and restart it if needed?
/etc/systemd/system/web2py-scheduler.service
-
[Unit]
D
This one is better for form.add_button() [see col_class_rest]
+uses smaller buttons [see btn-group-sm]
*def formstyle_bootstrap3_compact_factory(col_label_size=2,
col_help_size=6,**
input_class='input-sm', control_label='control-label-sm'):*
*
.__init__(*args, error_message=current.T('choose one or more', **kwargs))
in last
Dne čtvrtek 26. května 2016 11:27:38 UTC+2 Mirek Zvolský napsal(a):
>
> I hope this is better:
>
> from gluon import current
> from gluon.validators import IS_NOT_EMPTY, IS_IN_DB
> clas
I hope this is better:
from gluon import current
from gluon.validators import IS_NOT_EMPTY, IS_IN_DB
class IS_NOT_EMPTY_(IS_NOT_EMPTY):
def __init__(self):
super(IS_NOT_EMPTY_, self).__init__(error_message=current.T('this is
required'))
class IS_IN_DB_(IS_IN_DB):
def __init__(self, *
Thank you very much, Anthony.
Just the first sentence "...The purpose of translation is to translate
strings based on the requested language of a given HTTP request"
is enough to understand my stupid mistake.
Dne středa 25. května 2016 12:21:35 UTC+2 Mirek Zvolský napsal
I understand that it requires attention to use
- variables from models
- variables from controllers
- request, response, db, auth, T(?)
in modules.
Inside functions and method of class they can be used
- through function parameter/argument
- as current.x
Outside functions/methods, i.e. i
ks too.
However this in conflict with automatic migration - next migration will
break the collating.
Dne středa 20. května 2015 17:34:58 UTC+2 Mirek Zvolský napsal(a):
>
> Using SQLite I want have proper alphabetical sorting for the users
> language at the database level (from ORDER
For me was problem with formstyle=bootstrap3_inline that each field is to
much high: just first 5-7 items (from lets say ~20 form fields) were
visible on the standard monitor.
Now I use this as clone of the inline style:
Problem is the movement of the label (with control-label css class) to muc
You should create the database in Postgres database manager first (PgAdmin
or so...).
I use following steps:
You should read how to start work with new Postgres server.
In Linux/Debian I use "peer" authentication for user "postgres", i.e. I
have in
/etc/postgresql/9.4/main/pg_hba.conf
the line
curious if form.custom.inpval.place_id is the single and the
proper place where to get the parent foreign key (in oncreate).
Dne pondělí 16. května 2016 12:37:33 UTC+2 Mirek Zvolský napsal(a):
>
> Hi,
> smartgrid oncreate receives single parameter: form
>
> I have in parent table the count of
Hi,
smartgrid oncreate receives single parameter: form
I have in parent table the count of child records,
so when I add new child record in smartgrid,
I need to increase (+1) this count,
so I need obtain the parent record.
But in oncreate in
form.vars
is the parent_id not present.
I have found i
(), IS_IN_DB()]
so: IS_IN_DB()
then it works, but validation will not fail if no item is selected.
When I use: IS_EMPTY_OR(IS_IN_DB())
it works exactly so.
I have workaround:
IS_IN_DB(, multiple=(1,999))
Is this the best solution?
Dne čtvrtek 12. května 2016 19:06:14 UTC+2 Mirek Zvolský napsal(a
Friends, what I do wrong?
I want that user always can see 'name' instead of plain 'id'
In model I have related table with format:
format=lambda r: r.name
And in the master table I define the list:reference field so:
Field('ekosystemtypes', 'list:reference ekosystemtypes',
r
Mirek Zvolský napsal(a):
>
> Yes.
> I run with scheduler already. It is really nice and great !
> Going away from the ajax solution it was easy and there was almost no
> problem. (I have very easy parameters for the task and I return nothing,
> just I save into db.)
> The r
I'm sorry,
I read to late that you already use 'reference...'
So back to previous:
Add some printing or logging to see the order how the models really fire.
Dne čtvrtek 5. května 2016 16:00:02 UTC+2 Mirek Zvolský napsal(a):
>
> Models run in alphabetical order.
>
>
Models run in alphabetical order.
You should earlier define tables with primary keys for joins,
and later tables with foreign keys of such joins.
However if this is not possible,
there is an alternative syntax for foreign keys which will help:
Use
'reference joinedtable'
instead of
db.joinedtable
alphabetical order ?
Will
print 'db.py' < 'my_list.py'
print True in that environment?
And I don't know what web2py uses for alphabetical sorting of models.
Try add
print "db" and print "my_list"
into that models
to see if "my_list" really starts later.
If it is well,
cannot be db variable delet
UTC+2 Niphlod napsal(a):
>
> NP: as everything it's not the silver bullet but with the redis
> incarnation I'm sure you can achieve less than 3 second (if you tune
> heartbeat even less than 1 second) from when the task gets queued to when
> it gets processed.
>
is sure worth to
redesign it so.
Thanks you are patient with me.
Mirek
Dne pondělí 2. května 2016 20:35:05 UTC+2 Mirek Zvolský napsal(a):
>
> You are right.
> At this time it works for me via ajax well and I will look carefully for
> problems.
> If so, I will move to scheduler.
In modules instead of
def modulemethod(db):
I use
def modulemethod():
db = current.db # current.db=db is assigned in models
I hope that is correct.
Now I want reuse some module methods from script.
I run script.py from web2py environment like: python web2py.py -M -S app -R
script.py
In
ajax if your "feching" can be killed in the process
> is the only other way.
>
> On Sunday, May 1, 2016 at 8:09:23 PM UTC+2, Mirek Zvolský wrote:
>>
>> Thanks for info and tips, 6 years later.
>>
>> What I try to do
>> is a form with single input, w
1 - 100 of 283 matches
Mail list logo