[web2py] image in a jumbotron

2016-07-26 Thread R U
Sorry to bother with something so trivial but this problem is not getting
solved by me
I cannot get an image to show.  I am using python anywhere the image is
stored in static/images as

 DVimg.JPG

Then in views/default/index.html  I have the following.


 
  some big text
  la la 
  blah and blah




   

funny stuff.
interesting things
  
  

thanks in advance   Rob

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] check boxes with is_in_set

2016-12-08 Thread R U
hi all,

I understand this might be too much in the realm of "please write my code
for me" with that in mind let me ask.
Is it possible to use -- is_in_set -- to create a list of check boxes
instead of a drop-down?

what I am doing is: two types of users.  both have access to the same list.
 user type 1) can choose any and all of the items; user type 2) can only
choose 1.

I employ a drop down and is_in_set for the second type of user and that is
exactly what I am looking for.
Field('yo', requires=IS_IN_SET(['fl', 'ch',  'Fo',  'Mo',  'Ma', 'Ca',
'Foo', 'Mai', ...]))

The other I have a bunch of boolean fields such as.

Field('fl', 'boolean'),
Field('ch', 'boolean'),
Field('Fo', 'boolean'),
Field('Mo', 'boolean'),
Field('Ma', 'boolean'),
Field('Ca', 'boolean'),
Field('Foo', 'boolean'),
Field('Mai', 'boolean'),
Field

I would rather do this similar to the prior example, i.e. using a list.  I
think it would give me greater control over styling in the view and other
iterations I am planning on doing.  And I would like to keep originating
this from the model because all the model has to offer.

Thank you

Rob

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] Label in Form

2016-05-08 Thread R U
I am fairly new to all things coding and the learning has been slow.  My
question is how to insert a label or legend in a form when making the form
from the model.
If that is not possible I will need to make the form in the controller.
 the problem I run into there is how to create a boolean.  The example in
the book only shows how to make input fields.

My form has a section for dates and a couple groups of check-boxes and
would greatly benefit from some labels.

thanks Rob

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] loop bootstrap grid

2018-12-11 Thread R U
I am trying to loop a dict in a bootstrap grid where the key is on top of
the value(this does work); the key value pairs should sit side by side in
neat rows of 3 as in col-sm-3* (this does not happen)*

*Problem*: the print is either to the left or to the right with only one
div per row; they stack.
if i do *col-sm*  the div is in the middle.  if i use *col-sm-3* it is to
the left.
There is nothing in code indicating forced alignment.
Here's what i have in view



{{for key,val in suggestions.items():}}
  

  
  {{=key}}
 
 {{=val}}

 {{pass}}



the dict "suggestions" is stored in a model file my_dic.py; nothing unique;
simple key/value pairs.

any idea on how to get the key/value pairs to sit side by side until they
fill the row then make a new row until the loop is completed?

Thanks much

Rob

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] list of dates into database

2017-04-18 Thread R U
I am trying to insert many dates into a field.  Currently I am only getting
1 date inserted.
my overall goal is to insert many (semi random) dates into the database;
each user will have his/her own unique list.  Then later iterate over the
list having the date trigger some event if it equals today's date.

controller:
from datetime import date, datetime, timedelta
import random
from random import randint
dog = randint(3,25)
def perdelta(start, end, delta):
curr = start
while curr < end:
yield curr
curr += delta

for result in perdelta(date(2017, 11, 11), date(2018, 12, 12),
timedelta(days=dog)):
print str(result)

fun.zipdip.insert(infom=result)

model:
fun = DAL('sqlite://storage.sqlite')
fun.define_table('zipdip',
Field('infom')),

result in dal is:
3 selected
zipdip.id

zipdip.infom

1 
2018-11-30
2 
2018-12-07
3 
2018-11-30

but if the code is run for example in repl.it the result is the outcome I
am looking for

2017-11-11
2017-11-24
2017-12-07
2017-12-20
2018-01-02
2018-01-15
2018-01-28
2018-02-10
2018-02-23
2018-03-08
2018-03-21
2018-04-03
2018-04-16
2018-04-29
2018-05-12
2018-05-25
2018-06-07
2018-06-20
2018-07-03
2018-07-16
2018-07-29
2018-08-11
2018-08-24
2018-09-06
2018-09-19
2018-10-02
2018-10-15
2018-10-28
2018-11-10
2018-11-23
2018-12-06

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] function contingent on registration

2017-05-19 Thread R U
I would like to add a list of dates into my data base when the user signs
up.

from datetime import date, datetime, timedelta
import random
from random import randint
dog = randint(3,25)
def perdelta(start, end, delta):
curr = start
while curr < end:
yield curr
curr += delta

for result in perdelta(date(2017, 11, 11), date(2018, 12, 12),
timedelta(days=dog)):
print str(result)

##I have tried this but it does not make it contingent on registering.

auth.settings.register_onaccept.append(fun.zipdip.insert(infom=result))

Rob

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] form in bootstrap modal

2017-09-14 Thread R U
I have embedded a form inside of a bootstrap modal.  If the form is filled
in correctly it redirects.  If there are errors the modal closes and the
main page goes back to how it first looked.  Only when I click on the "Sign
up Here" button does it reveal that there were errors and what the errors
are.  Any idea on how to keep the modal open if there are errors

Thanks

view:::

 Sign up Here



  



  
×
Here is all the informaiton we will need
from you.
  
  some more info about this modal
  
  
  
{{=index}}
  
  
Close
  


  


controller::

def index():

form=SQLFORM(userdb.person)
if form.process(keepvalues=True).accepted:
response.flash = "Thank you for filling out the form."
redirect(URL('thank_you'))
elif form.errors:
response.flash = "form has errors"
else:
response.flash = "please fill out the form"
return dict(index=form)

-- 
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 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, visit https://groups.google.com/d/optout.


[web2py] override record in db

2017-10-31 Thread R U
I am curious of how to override an existing record in a database via a form.

Take for example a simple input of
db = DAL('sqlite://storage.sqlite')
db.define_table('person',
Field('email', requires=IS_EMAIL()),
Field('Your_Zipcode', requires=IS_NOT_EMPTY()),

If the same email address is entered that was previously in the db I get 2
records of the same e-mail.

I don't want to go through the built in auth.  I want to keep it simple.
If the person has to change his/her address s/he can simply fill in the
form and it overrides the existing record.

I get redirected to index when I use the following in the controller.
http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-and-insert-update-


What am i missing?

-- 
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 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, visit https://groups.google.com/d/optout.