OK so I could never figure out how to use this widget on itself, I ruptured
a few brain cells in the process and just decided to learn jquery. In case
anyone is ever in my position here is my working solution
1)scrap the second lazy_options_widget and just use the default web2py
select
I've tried everything, I'm sure its just something easy I'm missing or its
possibly just some needed javascript to trigger the ajax call. Anyone out
there wanna take a look, maybe give me a hint?
http://dev.s-cubism.com/plugin_lazy_options_widget
--
Resources:
- http://web2py.com
-
Here is an example of what I'm trying to do...
Don't forget to install the plugins
*IN CONTROLLER*
def index():
form = SQLFORM(db.product)
if form.accepts(request.vars, session):
session.flash = 'submitted %s' % form.vars
redirect(URL('index'))
return
Can you use the plugin_lazy_options_widget on itself? For example,
db.service_order.so_company.widget =
suggest_widget(db.company.company_name, id_field=db.company.id, limitby=(0,
10), min_length=1)
Below Works Just fine
db.service_order.so_location.widget = lazy_options_widget(
The first two args for the widget seem to reference the fields class
suggest_selected
in the source of the plugin they are referred to as on_key and off_key.
There is also a trigger option however I cant figure out what that does...
--
Resources:
- http://web2py.com
- http://web2py.com/book
I am working to move the company from paper to electronic, I work in a remote
office and have to fax all of this right now.
basic workflow:
Service Orders Created in the field at Job site get delivered to me every
day.
I take the service order and create a workup (basically an invoice)
The service order on the right is what is completed in the field by the
techs. (The part they bring me). The form on the left is what our company
calls a Work-Up. The work up Is created by me by taking the service orders
information and the information from a rolodex card. The rolodex card (not
I have a Form that will submit to multiple tables, most items reference
items.. For the life of me I cannot figure out how to make the form item
not a select box (default behavior). I would like a input/suggest input
field and if the input is not in db I would like to add it to DB. If it is
in
Thanks Anthony, I just didn't know what search terms to use, this video
http://www.tellmehow.nl/video.html someone linked is the functionality I
am looking for. However It looks like some of the attempts are pretty
outdated so I will attempt to re-write something. If successful I will
share
I actually went that route and then realized it would only work for one
field, I would Like to have a few fields with the autocomplete/add, I would
also like the form to have some conditional select boxes, and some fields
that would be auto-filled if some condition is met... I'm starting to
On Thursday, July 24, 2014 6:12:43 PM UTC-7, Anthony wrote:def myfunction():
if request.post_vars._autocomplete_name_aux and not request.post_vars.
category:
request.post_vars.category = db.category.insert(name=request.
post_vars._autocomplete_name_aux)
return
Oh and the conditional problem is that I would like to populate items, Like
if you chose a city that's in the database it would auto populate the state
input because the city table has a reference to the state.. I would also
like to keep the auto-complete functionality (if not in db add to db)
but I'm working on it
:))
Thanks in advance!
Jesse Ferguson
EXAMPLE MODEL
db.define_table('invoice',
Field('price_list', 'integer'),
Field('account_code','string'),
Field('company', 'string'),
Field('attn', 'string'),
Field('customer_order_number', 'string'),
Field
I think this would work better however I am not sure about the items.. is
the item_entry table how its normally done? Examples online vary...
A completed Service order would have multiple Item_entry references... Just
doesn't seem like the right way to do it..
db.define_table('company',
I deployed my app using the nginx script and created a routes.py file like
so:
# -*- coding: utf-8 -*-
routers = dict(
BASE = dict(
default_application='myapp', )
)
However when i go to mywebsite.com i get
invalid request
but mywebsite.com/myapp loads the
It seems to be working now... I guess it just takes a while to kick in??
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message
Im trying to wrap my head around web2py and AJAX, I can use it to load a
page.html however Its a little unclear to me when or how to use the
page.load.
For example, say I have a table of database items and I want to check that
table every x amount of seconds and add a new trtdelement/td/tr but
In the long run i would like to do something like http://blockchain.info/
's main page and have a semi live feed of database items that are added and
removed depending on what the controller returns
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
I Think the way to go about this would be to have the .load file a js
script that gets the current list of items on the table, then compare that
list to the one returned and remove the items if they are not in the list
and then add the items that are in the list does that sound sane?
--
Brilliant! I skipped that part of the book thinking it was about loading in
java helpers or extending web2py somehow... Just read the LOAD docs and i
think it is exactly what I needed.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
I'm building a single page app with a lot of data from the database
displayed, I would like to have it auto-refresh or update the tables with
the newest information.
Its not time critical (ie it doesnt need to be instantanous maybe every
60secs)
What are my options?
AJAX timebased
anthony copy Mandar's Code exactly and then jus go and add a few parents
then try to add a child with two parents, you will encounter this error..
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Traceback (most recent call last):
File C:\Users\User\Desktop\web2py\gluon\restricted.py,
On Tuesday, May 13, 2014 12:52:24 PM UTC-7, Jesse Ferguson wrote:
anthony copy Mandar's Code exactly and then jus go and add a few parents
then try to add a child with two parents, you will encounter this error..
Traceback
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
Traceback
I FIgured it out, I was missing the field name when trying to add values i
was doing row.update(data) instead of row.update(posts=data)
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
ok so it actually doesnt work which is really strange. it works on
console however when i do it in a scheduled task it jacks up the database
somehow, i think I may be inserting the references incorrectly... I will
investigate this tonight and try to give everyone an answer
--
Resources:
https://groups.google.com/forum/#!searchin/web2py/list$3Areference/web2py/pXBj0EhX3iA/vamglS5txQsJ
seems this may be a bug in web2py... Does anyone know if this bugfix is
still only in trunk or if it has been put into stable?
--
Resources:
- http://web2py.com
- http://web2py.com/book
how can i add a reference in code? I have a scheduled task and i want to
update a field to reference 10 most current posts
db.define_table('daily',
Field('example'),
Field('datetime'),
Field('current', 'boolean')
Field('posts','list:reference post'),
)
Thank you Ricardo, I watched videos and read into the docs of everything
you listed, Only thing I am bit unclear on is WSGI, If Im understanding
correctly its really just a Middleware that sits between a Sever and a
python Framework. However Im a bit confused How the stack works when
ah yes i keep forgetting that pep333 i believe
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to
OK so I've been reading/researching and I'm still trying to wrap my head
around how the above code works,
First let me define what I *think* is going on,
The script imports socket.io modules needed and the imports web2py's
wsgibase...
SocketIOServer (('0.0.0.0', 8080), wsgibase,
I'm trying to learn how to use websocket-io and the only thing I could find
about using it with web2py is here
: https://groups.google.com/forum/#!newtopic/web2py/web2py/nJmML_jeZfc
I can get the example working, however I dont really understand whats going
on with run_iochat.py
from
sorry to hop in and ask a silly question but, when you say init the js on
the field how is that supposed to be done in web2py? Is it done in the
view? would it be ideal to put the js in the template and then pass params?
any named optional attribute is passed to the form tag
for
Is there a way to do this using a autocomplete field? would i put the logic
in a custom validator? or is there a easier better way?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
more like it is now (plus and minus next to input)
however i would like it to be a drop down of referenced items... for the
life of me i cannot figure out how to have both.
On Mon, Dec 9, 2013 at 12:16 PM, Jesse Ferguson ifl...@gmail.comjavascript:
wrote:
Is there a way to do
How would i Implement a custom widget using this
http://harvesthq.github.io/chosen/? Or is there an easier way to use this?
I assume I can probably just pass the table rows and use something like
{{response.files.insert( ALL THE REQUIRED JS STUFF HERE )
{{=form.custom.begin}}
select
Ok so that didn't work so great... now I am trying to use this slice as a
template to make a widget:
http://www.web2pyslices.com/slice/show/1411/widgets-widgets-widgets
anyone know of any tutorials that would a novice like myself?
--
Resources:
- http://web2py.com
-
I have watched the first few videos and they are so helpful for a beginner
like myself, I would like to thank you for these! I would also like to
request that you share the source code, I have been using the videos as
reference and its a pain to try to find the parts that explained xyz
}}
On Monday, December 2, 2013 9:20:38 PM UTC-8, Jesse Ferguson wrote:
I have two tables set up and i want to show the TimeCard with all the
entries for said time card however im unsure of how to create such a view...
CONTOLLER:
def timecard_index():
tcrows =db(db.timecard).select(orderby
I have two tables set up and i want to show the TimeCard with all the
entries for said time card however im unsure of how to create such a view...
CONTOLLER:
def timecard_index():
tcrows =db(db.timecard).select(orderby=~db.timecard.tc_date)
tcinputs
I will check out your suggestions, however for now i have solved like this
SOLVED WITH THIS:
db.define_table('timecard',
Field('tc_date','date'),
Field('employee', 'reference
employee',requires=IS_IN_DB(db,'employee.id','%(fname)s %(lname)s')),
ok im going crazy here... Ive tried every example or solution i can find
and nothing works for me...I am trying to build a Time Card app so i can
keep track of employees time cards and I want to make sure only one card
per employee per day can be submitted... So the two fields need to validate
OK I figured it out!
{{include 'web2py_ajax.html'}}
script
jQuery.timeEntry.setDefaults({show24Hours: false, showSeconds: false,
timeSteps:[1,30,1]});
/script
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
ok so the format now looks Great on the form however on submitting it i get
this type 'exceptions.ValueError' invalid literal for int() with base 10:
'00PM'
It seems like its trying to store the value 00PM as mins which should be an
integer... however i was under the impression that the dal
Having a hard time figuring out this one and after googling my eyeballs off
Im here to beg for someone to throw me a bone, here is my code:
MODEL:
db.define_table('timecard_entry',
Field('timecard', 'reference timecard', readable=False,
writable=False,),
44 matches
Mail list logo