Dave / Anthony,

Thanks for your input and confirmation. I will look into the code to see 
how i can use the uuid to separate files for multi-tenant purpose.

On Tuesday, September 26, 2017 at 5:53:30 PM UTC+8, Dave S wrote:
>
>
>
> On Monday, September 25, 2017 at 11:03:59 PM UTC-7, Rudy wrote:
>>
>> Hi i am working to build a multi-tenant application which has a company 
>> table which stores logo and other data. I defined a company table, added 
>> extra fields in auth_user and created an action (simplified version) like 
>> below. web2py uploaded the logo image file under 
>> myapp/uploads/company.logo/af/company.logo.afxxxxxxxx.png, but according to 
>> the document(applications/test/uploads/person.image.XXXXX.jpg), I should 
>> not have had the company.log/af directories, could anyone explain why?
>>
>
> Because you set "uploadseparate"?
>
> gluon/packages/dal/pydal/objects.py, at about 49% (windows more is only 
> smart enough to give a percent), explains using the first 2 letters of 
> uuid_key.
>  
>
>> [...]
>>
>  
>
>> db.define_table('company',
>>                 Field('company_name', requires=IS_NOT_EMPTY(), 
>> unique=True), 
>>                 Field('phone'),
>>                 Field('company_email', requires=IS_NOT_EMPTY()),
>>                 Field('website'),
>>                 Field('logo', 'upload', label='Company Logo', 
>> uploadfolder=os.path.join(request.folder,'uploads'), uploadseparate=True), 
>> # 23x23mm, 300K recommended
>>                 Field('status', requires=IS_IN_SET(COMPANY_STATUS), 
>> default='Active', readable=False, writable=False),
>>                 format='%(company_name)s')
>>
>>
>>  
> /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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to