[web2py] Linking multiple many to many relationships

2019-07-19 Thread Gavin Kenny
Hi,

This is a bit of a noob question. I run a club for children, where we have 
a quiz night and I would like to develop a web2py app to speed up the 
scoring and create a leaderboard. I would like to use web2py as I love the 
elegant design, the portability and the focus on security, but I am not an 
expert web app or database developer.

The requirement is : 

1) Each child has a name and then groups of children form teams - standard 
one to many relationship
2) There are number of rounds and each round has a number of questions - 
again a one to many relationship
3) Each question will receive a mark it isn't just yes or no but a score 
out of 10.
4) I understand that the team to round relationship is a many to many 
relationship

But ...
How do I set up a model and controller, that allows me to record the scores 
of each individual question for each team? I am going round in circles as 
it feels like a many to many to many relationship?

Any guidance would be gratefully received.

Gavin

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/ca311d1b-ab5f-428d-95c0-b4182e35481b%40googlegroups.com.


[web2py] Re: Many apps in a single app.

2019-07-19 Thread Daniel Guilhermino
Leonel,

very interesting this possibility, it is possible to avoid rewriting enough 
thing, thanks for sharing!

Em terça-feira, 9 de julho de 2019 18:56:35 UTC-3, Leonel Câmara escreveu:
>
> This looks good, if you want to take it a step further and have something 
> like sub-controller-functions in your apps that will have their own views 
> folder inside the app views folder you can use this decorator I made:
>
> def parent_controller(views_folder=None, pop_args_zero=True):
> """
> Decorator to turn a controller function into a parent of other 
> controller
> functions.
>
> This allows you to have many controller functions in a single 
> controller
> function each having their own view inside a folder.
>
> :views_folder: Folder where it gets the views for the children 
> controllers
>by default uses the parent controller name.
> :pop_args_zero: whether to remove or not the name of the children 
> controller
> from request.args. By default True.
> """
> if views_folder is None:
> views_folder = os.path.join(request.controller, request.function)
> def wrapper(action):
> def f(_action=action, *a, **b):
> command = None
> try:
> if pop_args_zero:
> parseme = request.args.pop(0)
> else:
> parseme = request.args(0)
> if '.' in parseme:
> try:
> command, extension = parseme.split('.')
> except ValueError:
> raise HTTP(400, "invalid arguments")
> else:
>  command, extension = parseme, 'html'
> except (IndexError, TypeError): # pop from empty list
> command, extension = 'index', 'html'
> 
>
> response.view = os.path.join(views_folder, command + '.' + 
> extension)
>
> requested_controller = _action().get(command, None)
> if requested_controller:
> return requested_controller()
> else:
> raise HTTP(404)
> f.__doc__ = action.__doc__
> f.__name__ = action.__name__
> return f
> return wrapper
>
>
> Then in the app1.py controller you could do something like:
>
> @auth.requires_login()
> @parent_controller()
> def pages():
> def index():
> ...
> return {}
>
> def insert():
> ...
> return something
>
> def delete():
> ...
> return something
>
> return locals()
>
> And in the views you would have
>
> app1/
> pages/
> index.html
> insert.html
> delete.html
>
>
> @villas note that in your case it's probably better to have a single 
> application do the log in and then use CAS.
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/849111d4-5600-49f5-815c-2f03130e0832%40googlegroups.com.


[web2py] Re: Too much sessions...

2019-07-19 Thread Gaël Princivalle
Hi Zoltán.

python-six module is installed.

0_memcache.py is like in the documentation:
from gluon.contrib.memcache import MemcacheClient
memcache_servers = ['127.0.0.1:11211']
cache.memcache = MemcacheClient(request, memcache_servers)
cache.ram = cache.disk = cache.memcache

I've added this in the model db.py:
from gluon.contrib.memdb import MEMDB
session.connect(request, response, db=MEMDB(cache.memcache))

The last row generate this ticket:
Ticket ID

2a00_23a8_400d_c001_3d4c_5b50_35a9_dfdf.2019-07-19.12-25-46.c3413f14-b228-4390-bc14-2f7092907e01
Versione
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47
Python Python 2.7.5: /usr/bin/python (prefix: /usr)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.

Traceback (most recent call last):
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py", line 464, in 
wsgibase
session._try_store_in_db(request, response)
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py", line 1183, in 
_try_store_in_db
record_id = table.insert(**dd)
  File "/home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py", line 
264, in insert
raise RuntimeError("Too many ID conflicts")
RuntimeError: Too many ID conflicts

Error snapshot [image: help] 


(Too many ID conflicts)

inspect attributes
Frames
   
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/main.py in wsgibase 
   at line 464* code arguments variables
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/globals.py in 
   _try_store_in_db at line 1183* code arguments variables
   - 
   
   *File /home/tasko/webapps/w2p_2_14_16/web2py/gluon/contrib/memdb.py in 
   insert at line 264* code arguments variables
   Function argument list
   
   (self=}>, **fields={'client_ip': 
   '2a00.23a8.400d.c001.3d4c.5b50.35a9.dfdf', 'locked': False, 
   'modified_datetime': datetime.datetime(2019, 7, 19, 12, 25, 46, 854949), 
   'session_data': 
   
'\x80\x02cgluon.globals\nSession\nq\x01}q\x02(U\x19_formkey[no_tab...\x13(h\x0bU\r75.0.3770.142q\x14h\rU\x06Chromeq\x15u\x85Rq\x16u\x85Rq\x17u\x85Rq\x18.',
 
   'unique_key': '25d6cb33-4709-4b14-987d-06aef044ac67'})
   Code listing
   
   259.
   260.
   261.
   262.
   263.
   264.
   
   265.
   266.
   267.
   268.
   
   for i in range(3):
   id = self._create_id()
   if self.get(id) is None and self.update(id, **fields):
   return long(id)
   else:
   raise RuntimeError("Too many ID conflicts")
   
   
   def get(self, id):
   val = self._tableobj.get(self._id_to_key(id))
   if val:
   
   
Do you know why?

Il giorno giovedì 18 luglio 2019 12:58:50 UTC+2, Gaël Princivalle ha 
scritto:
>
> Hi Zoltán, for the moment I've modified my crontab for deleting the 
> sessions every hour.
>
> I'll try to install python-six module and store the sessions in the memory 
> in the next days.
>
> Il giorno giovedì 18 luglio 2019 11:03:37 UTC+2, Fekete Zoltán ha scritto:
>>
>> Hi Gael!
>>
>> Could you solve the problem? Pls. give a short feedback.
>>
>> Regards,
>> Zoltán
>>
>> 2019. július 13., szombat 9:03:17 UTC+2 időpontban Massimo Di Pierro a 
>> következőt írta:
>>>
>>> what os is this?
>>>
>>> On Friday, 12 July 2019 01:00:03 UTC-7, Gaël Princivalle wrote:

 Hi all.

 In my sessions folder all sessions are stored in separated sub-folders, 
 068,069...
 The file system don't accept more than 512 sub-folders in a folder.
 When I reach 512 sub-folders the website is down.
 Now for avoiding this problem I delete all the sessions with a crontab 
 job every 12 hours, but it's not enough.

 Obviously I can imagine that deleting all the sessions means also 
 disconnecting all the users, that's not a good thing.

 Can I store the sessions in the DB instead of the file system?

 And what about that? I don't understand where I must add it, and it 
 seems that the sessions storage for my website works already like that,
 http://web2py.com/books/default/chapter/29/04/the-core#Separate-sessions

 Thanks.




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/627803f7-7133-473b-8a8f-0732b609d68c%40googlegroups.com.


[web2py] Re: my grating help

2019-07-19 Thread Leonel Câmara
I would check manually in the database if the table is there with the 
structure defined in the model. If it is then do a fake migrate. If it's 
not then delete the table file (you already did) and do a regular migrate.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/60d87e93-f143-4559-bb3a-dc4ee5eeb388%40googlegroups.com.


[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Leonel Câmara
You need another table which is an answer table, the answers will have a 
reference to the question and the team that answered.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/02b8f337-6754-4f4c-a8dd-ceefbde63b4a%40googlegroups.com.


[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Gavin Kenny


On Friday, 19 July 2019 15:26:05 UTC+1, Leonel Câmara wrote:
>
> You need another table which is an answer table, the answers will have a 
> reference to the question and the team that answered.
>

Thank you,

So to check my understanding, the Answer Table would have 3 fields, an 
answer field and then two reference fields, one for question.db and one for 
team.db?

Also,
The questions are not uniquely numbered but as part of the round, i.e. 
Round 1, Question 1, Q2, Q3, Q4 and Round 2, Q1, Q2, Q3.  etc
Would I therefore link the answer table to the round table and then need 
some kind join to allow me to get to the question?


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/55acb590-ea07-4657-b6ed-0018e6c88eb5%40googlegroups.com.


[web2py] Re: Sometging wrong with utf-8

2019-07-19 Thread Константин Комков
rows = db(
(db.recipes.ID_CUISINE==db.cuisines.id)
).select(db.recipes.ALL)
db._lastsql >>>
('SELECT recipes.ID_CUISINE, recipes.DESCRIPTION, recipes.ID_AUTHOR, 
recipes.ID_CATEGORY, recipes.EXPIRATION_DATE, recipes.IMAGE FROM recipes, 
cuisines WHERE (recipes.ID_CUISINE = cuisines.id);', 0.04505515098571777)
rows = db(
(db.recipes.ID_CUISINE==db.cuisines.id)
).select(db.recipes.ALL,db.cuisines.NAME)
db._lastsql >>> Error: 'utf-8' codec can't decode byte 0xf0
rows = db(db.recipes).select(join=db.cuisines.on(db.recipes.ID_CUISINE == db
.cuisines.id))
db._lastsql >>> Error: 'utf-8' codec can't decode byte 0xf0
my tables:
db.define_table(
'recipes',
Field('ID_CUISINE','integer'),
Field('DESCRIPTION'),
Field('ID_AUTHOR','integer'),
Field('ID_CATEGORY','integer'),
Field('EXPIRATION_DATE'),
Field('IMAGE'),
primarykey=['ID_CUISINE','ID_AUTHOR','ID_CATEGORY'],
migrate=False
)

db.define_table(
'cuisines',
Field('NAME','string'),
migrate=False
)

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/d9c4ad66-a03a-47ec-b616-baa030f03a49%40googlegroups.com.


[web2py] Re: Sometging wrong with utf-8

2019-07-19 Thread Константин Комков
That error was created becouse in 'cuisines' table field NAME have charset 
'NONE' and collate 'NONE'. 
>
>
>- 
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/97b942c7-a604-402c-be89-f709796338dd%40googlegroups.com.


Re: [web2py] Error PIL path

2019-07-19 Thread Márcio Luis Dresch
#this is a copy from
http://www.web2pyslices.com/slice/show/1522/generate-a-thumbnail-that-fits-in-a-box

#modules\smarthumb.py
from gluon import current
import os
try:
from PIL import Image
except:
import Image

def SMARTHUMB(image, box, fit=True, name="thumb"):
'''Downsample the image.
@param img: Image -  an Image-object
@param box: tuple(x, y) - the bounding box of the result image
@param fit: boolean - crop the image to fill the box
'''
if image:
request = current.request
img = Image.open(request.folder + 'uploads/' + image)
#preresize image with factor 2, 4, 8 and fast algorithm

factor = 1
while img.size[0] / factor > 2 * box[0] and img.size[1] * 2 / factor > 2 *
box[1]:
factor *= 2
if factor > 1:
img.thumbnail((img.size[0] / factor, img.size[1] / factor), Image.NEAREST)

#calculate the cropping box and get the cropped part
if fit:
x1 = y1 = 0
x2, y2 = img.size
wRatio = 1.0 * x2 / box[0]
hRatio = 1.0 * y2 / box[1]
if hRatio > wRatio:
y1 = int(y2 / 2 - box[1] * wRatio / 2)
y2 = int(y2 / 2 + box[1] * wRatio / 2)
else:
x1 = int(x2 / 2 - box[0] * hRatio / 2)
x2 = int(x2 / 2 + box[0] * hRatio / 2)
img = img.crop((x1, y1, x2, y2))

#Resize the image with best quality algorithm ANTI-ALIAS
img.thumbnail(box, Image.ANTIALIAS)

img.thumbnail.show()

root, ext = os.path.splitext(image)
thumb = '%s_%s%s' % (root, name, ext)

#save it into a file-like object
img.save(request.folder + 'uploads/' + thumb)

return thumb

#models\db.py

Article = db.define_table('article',
Field("title"),
Field("article_text", "text"),
Field("picture", "upload", uploadfoder='uploads'),
Field("thumbnail", "upload", uploadfoder='uploads')
)


from smarthumb import SMARTHUMB

Article.thumbnail.compute = lambda row: SMARTHUMB(row.picture, (200,200))


#controllers\default.py
def addarticle():
form = SQLFORM(Article).process()
return dict(form=form)

def showarticle():
id = request.args(0) or redirect(URL('default', 'index'))
article = Article[id]
return dict(article=article)

#views\addarticle.html
 Add an article 

{{=form}}

#views\showarticle.html

 {{=article.title}}


   


{{=MARKMIN(article.article_text)}}



Em qui, 11 de jul de 2019 às 05:28, Nico de Groot 
escreveu:

> The example code assumes that the images are in the standard  ‘uploads’
> folder. Without looking at at your code, it seems that you defined - in
> your model file - the download folder to be ‘imageuploads’. That would
> explain why the thumbnail is not found.
>
> Nico de Groot
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/20f37e0e-df44-4eba-a037-74ae476e21fc%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAGweixK10XETemtYBs4c0bmOn6asNtgQvNwq%3Dnrw0VRhFf36%2BA%40mail.gmail.com.


[web2py] Re: my grating help

2019-07-19 Thread Dave S


On Friday, July 19, 2019 at 6:45:42 AM UTC-7, Leonel Câmara wrote:
>
> I would check manually in the database if the table is there with the 
> structure defined in the model. If it is then do a fake migrate. If it's 
> not then delete the table file (you already did) and do a regular migrate.
>

Oh, it's quite healthy.   I've taken the precaution of using "\o" to save a 
CSV copy.

I think I have TRUE for all of db migrate, fake_migrate_all, table migrate, 
and table fake_migrate, but no joy.

/dps

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a85b5873-984d-4996-99a8-aa5c14abbac9%40googlegroups.com.


[web2py] Re: Linking multiple many to many relationships

2019-07-19 Thread Dave S


On Friday, July 19, 2019 at 8:34:04 AM UTC-7, Gavin Kenny wrote:
>
>
>
> On Friday, 19 July 2019 15:26:05 UTC+1, Leonel Câmara wrote:
>>
>> You need another table which is an answer table, the answers will have a 
>> reference to the question and the team that answered.
>>
>
> Thank you,
>
> So to check my understanding, the Answer Table would have 3 fields, an 
> answer field and then two reference fields, one for question.db and one for 
> team.db?
>
>
For small tables (tens to hundreds of entries), recursive selects might be 
the practical choice.
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Recursive-selects>


 

> Also,
> The questions are not uniquely numbered but as part of the round, i.e. 
> Round 1, Question 1, Q2, Q3, Q4 and Round 2, Q1, Q2, Q3.  etc
> Would I therefore link the answer table to the round table and then need 
> some kind join to allow me to get to the question?
>


Good luck!

/dps
 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/4e23cfb7-8a72-41e7-b81d-1aa0c634acc4%40googlegroups.com.


[web2py] DAL and temporary tables

2019-07-19 Thread Dave S
Does the DAL have any built-in support for temporary tables?  

I'm thinking that the best I can do here is to build the table inside my 
script or module (aka "model-less") and drop the table at the end.  Do 
table files persist in "model-less"?  There wouldn't be a conflict, though, 
any more than model-ful table files persisting through repeated 
define.table() calls.  Right?

/dps




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/a7473a53-c440-4c84-9c85-77b0fa09151f%40googlegroups.com.


[web2py] Re: Display a list in SQLFORM.grid

2019-07-19 Thread Massimo Di Pierro
SQLFORM.grid( maxtextlength=1e9)

On Monday, 8 July 2019 15:21:30 UTC-7, Dave S wrote:
>
>
>
> On Thursday, July 4, 2019 at 11:45:48 PM UTC-7, Massimo Di Pierro wrote:
>>
>> Can you explain more in detail what you want to do?
>>
>
> At the risk of demonstrating that I'm not a mind-reader,
> I'm going to suggest that give a list
> [x,y,z,aa,bb,...]
>
> where each element is in some sense a row (perhaps in the DAL sense),
> display each row such that each cell does wrap instead of truncate.
> Perhaps only some columns need the wrap, perhaps all.
>
> That is, for element x[j] from the above list, the x[j] ends up 
> styled wrap instead of truncate.
>
> Now that I'm out on the limb, where's my saw?
>
> /dps
>
>  
>
>>
>> On Tuesday, 11 June 2019 14:16:36 UTC-7, Quang Lam wrote:
>>>
>>> how could i wrap a list and display it into SQLFORM.grid  to ensure 
>>> there is no characters in the list truncated when displayed 
>>> Please help
>>>
>>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/02855c89-4199-4d2b-9cd8-d0ab9fe40739%40googlegroups.com.


[web2py] Re: Web2py Database Connection with SQL Server and Trusted Connection?

2019-07-19 Thread Massimo Di Pierro
Hello Costanza,

sorry for the late reply. I am not too familiar with mssql but your 
database should be identified by a connection string also known as DSN
https://www.connectionstrings.com/sql-server/

In web2py you would use:

db = DAL('mssql://...')

where ... is your dsn string.

nas wrote:

> Hi! I'm a beginner on web programming and just started with web2py. So I 
> was wondering how should I connect from my web2py site to a SQL Server 
> Database? I need to mention that my connection string uses 
> *Trusted_Connection**=True*, so I don't connect with user nor password.
> I'm sorry! It may be really simple but I just didn't get a working 
> solution on the web.
>
> Thanks!
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/b74948a3-bac0-4300-ad9b-28b210a04737%40googlegroups.com.


[web2py] Web2Py and ldap integration

2019-07-19 Thread Davidiam
Hello,

I have read and implemented the recipe for Windows active directory ldap 
integration with Web2Py (
http://www.web2py.com/books/default/chapter/29/09/access-control) and for 
the most part the documentation is clear except for the last bit where it 
refers to : 

from gluon.contrib.login_methods.ldap_auth import ldap_auth
auth.settings.login_methods.append(ldap_auth(mode='ad',
   server='my.domain.controller',
   base_dn='ou=Users,dc=domain,dc=com'))

For me there are 2 things that aren't clear here :
1) Where should this code be inserted ?  In the default.py controller or in 
db.py or somewhere else ?
2) We have multiple domain controllers in our domain, do we need to supply 
a specific server for the server parameter ?

An example of implementing this with the welcome application would be 
appreciated, specifying the file which was modified. 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/3f5413ca-f2d1-4576-877c-3a2cd0f745b1%40googlegroups.com.


[web2py] Web2Py on IIS, multiple apps under virtual directories

2019-07-19 Thread Davidiam
Hello,

I have setup Web2Py with IIS using fastcgi and I got the application 
running (currently testing using the Welcome app).

In our project we will have multiple applications running parallel to each 
other, each under a separate application.
To do this, we have created the following structure : 
D:\web2py\
D:\web2py\QF1
D:\web2py\QF2
D:\web2py\QF3

Under these directories we copied the web2py files (so the web.config, 
routes.py are in the QFx directories).
We converted the virtual directories to apps and set the user rights 
according to the documentation.

In each of the routes.py, we set the path_prefix according to the name of 
the virtual directory :
for example, for QF1 we put :
routers = dict(BASE=dict(path_prefix = "qf1"))

When we run the welcome app for qf1, it works, but then when we try to run 
qf2 it immediately redirects to qf1, and the same for qf3.
The app to which it redirects can vary depending on the first one we run 
(after a while it seems to reset itself).
We do not see what is causing the redirect, I have tried modifying the 
web.config but so far no success in fixing the issue.
Is there any way to log this ?

Fastcgi is configured at server level.  We are using one application pool.  
We tried enabling logging but without success.
Any help would be appreciated.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/acc994ce-6b1d-4764-bf92-ba0a8e4e2fc6%40googlegroups.com.


Re: [web2py] Re: please help testing web3py

2019-07-19 Thread KLL
You can view it as a web3py app if you follow the try me from the github 
source.
There are some failures with loading examples app and _scaffold app, but 
_documentation worked for me.

http://127.0.0.1:8000/_documentation


On Tuesday, July 16, 2019 at 9:48:14 AM UTC-4, Johann Spies wrote:
>
>
>
> On Sun, 14 Jul 2019 at 05:48, Massimo Di Pierro  > wrote:
>
>>
>> I posted some preliminary documentation
>> https://github.com/web2py/web3py/tree/master/apps/_documentation
>>
>>
>>
> I do not see a Makefile to convert the .mm-files to html-documentation. 
> How do I read the documentation?
>
> Johann
> -- 
> Because experiencing your loyal love is better than life itself, 
> my lips will praise you.  (Psalm 63:3)
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/c6d74fcc-7af9-47f3-aa0b-749b5c230539%40googlegroups.com.


[web2py] Web2Py and Angular 4,5,6,7,8... MIXED

2019-07-19 Thread irving navarro
 any know how do that?,,  wanna  develop the view on Angular 7 and  make  
web2py to backend..

any have some themplate ?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/8373a347-641a-4264-9ece-397fa49aee07%40googlegroups.com.


[web2py] Anthony was right... web3py has a big naming conflict

2019-07-19 Thread Massimo Di Pierro
Anthony was right... web3py has a big naming conflict with web3py (python 
library for web3).
I am considering renaming it. Not sure I want to start a competition here. 
For a name to be good I must own the domain and it must not be copyrighted. 
Not many options.
Just heads up.

Massimo

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f221a730-387a-4e92-a25d-c34d657fa0fb%40googlegroups.com.


Re: [web2py] Re: please help testing web3py

2019-07-19 Thread Massimo Di Pierro
Can you tell me more about those failures?

On Friday, 19 July 2019 22:30:00 UTC-7, KLL wrote:
>
> You can view it as a web3py app if you follow the try me from the github 
> source.
> There are some failures with loading examples app and _scaffold app, but 
> _documentation worked for me.
>
> http://127.0.0.1:8000/_documentation
>
>
> On Tuesday, July 16, 2019 at 9:48:14 AM UTC-4, Johann Spies wrote:
>>
>>
>>
>> On Sun, 14 Jul 2019 at 05:48, Massimo Di Pierro  
>> wrote:
>>
>>>
>>> I posted some preliminary documentation
>>> https://github.com/web2py/web3py/tree/master/apps/_documentation
>>>
>>>
>>>
>> I do not see a Makefile to convert the .mm-files to html-documentation. 
>> How do I read the documentation?
>>
>> Johann
>> -- 
>> Because experiencing your loyal love is better than life itself, 
>> my lips will praise you.  (Psalm 63:3)
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/32140609-155a-4027-95e4-a58bc63879b9%40googlegroups.com.