[web2py] Does web2py has samothing similar to Django's {% verbatim %} ?

2018-05-20 Thread Najtsirk
Does web2py have a tag to stop a section in the view from rendering tags? 
So i can use small Vue.js snippets?


Thanks.
K

-- 
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] Re: Best practice regarding applications

2017-09-07 Thread Najtsirk
Thanks!

On Saturday, 2 September 2017 06:16:17 UTC+2, Massimo Di Pierro wrote:
>
> It is fine to have one web2py and as many domains as you need. It should 
> not affect performance provided you take advantage of the cores you have. 
> That means you want to make sure you use nginx+uwsgi or gevent or gunicorn 
> and have about one process per core.
>
> On Friday, 1 September 2017 05:17:42 UTC-5, Najtsirk wrote:
>>
>> Hello,
>>
>> after a long years of active use of web2py it came to me that probably I 
>> am not doing it as it should! :)
>>
>> So within one web2py i have several applications and each one is acctualy 
>> a separate site ona a different domain. Is this best pracitce or should i 
>> have one web2py instance for every site and applications are just 
>> functional subsections of the particular site?
>>
>> What is the performance impact of one way over the other (if any)?
>>
>> Thanks for your answers.
>>
>> Kristjan
>>
>

-- 
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] Best practice regarding applications

2017-09-01 Thread Najtsirk
Hello,

after a long years of active use of web2py it came to me that probably I am 
not doing it as it should! :)

So within one web2py i have several applications and each one is acctualy a 
separate site ona a different domain. Is this best pracitce or should i 
have one web2py instance for every site and applications are just 
functional subsections of the particular site?

What is the performance impact of one way over the other (if any)?

Thanks for your answers.

Kristjan

-- 
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] Re: 'Column table.id not found (SQLTABLE)'

2017-06-03 Thread Najtsirk
I checked this and I had pydal installed as a global module. 
When I removed it web2py's DAL works ok.



On Saturday, 3 June 2017 18:30:05 UTC+2, Najtsirk wrote:
>
> +1
> Have this problem too!
>
> On Saturday, 3 June 2017 18:13:18 UTC+2, Maurice Waka wrote:
>>
>> Hi did anyone get to solve this error? I seem to be locked in it also
>> Regards
>>
>> On Monday, March 20, 2017 at 4:39:13 PM UTC+3, Santiago Cartasegna wrote:
>>>
>>> Are you trying to use a table that you have defined in your database and 
>>> not in web2py? 
>>> If it is the case you must add an id field with autoincremental
>>>
>>> El domingo, 12 de marzo de 2017, 20:27:08 (UTC-3), LoveWeb2py escribió:
>>>>
>>>> Keep getting this error for all of my tables!! What is going on?
>>>>
>>>> What information would be helpful for me to post to get 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: 'Column table.id not found (SQLTABLE)'

2017-06-03 Thread Najtsirk
+1
Have this problem too!

On Saturday, 3 June 2017 18:13:18 UTC+2, Maurice Waka wrote:
>
> Hi did anyone get to solve this error? I seem to be locked in it also
> Regards
>
> On Monday, March 20, 2017 at 4:39:13 PM UTC+3, Santiago Cartasegna wrote:
>>
>> Are you trying to use a table that you have defined in your database and 
>> not in web2py? 
>> If it is the case you must add an id field with autoincremental
>>
>> El domingo, 12 de marzo de 2017, 20:27:08 (UTC-3), LoveWeb2py escribió:
>>>
>>> Keep getting this error for all of my tables!! What is going on?
>>>
>>> What information would be helpful for me to post to get 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Semantic UI for SQLFROM.grid

2017-05-26 Thread Najtsirk
Hi,

I would like to have Semantic UI in my application. However the 
SQLFORM.grid has Bootstrap by default. Is there "the right" way to 
implement SQLFORM.grid with SemanticUI?

Can somebody point me into the right direction?

Thanks,
Kristjan

-- 
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] SQLFORM: how to show image thumbnail

2017-02-20 Thread Najtsirk
Hi,

i have the following problem.

*Model:*
db.define_table('person',
 Field('name', 'string', label='Name'),
 Field('image','upload', label='Image', autodelete=True, 
uploadfolder=os.path.join(request.folder, 'uploads/persons'))

*Controller:*
def person():
form = SQLFORM(db.person, request.args(0)).process()
return dict(form=form)

*View:*
{{=form.custom.begin}}

{{=form.custom.widget.name}}

{{=form.custom.widget.image}}

{{=form.cusom.submit}}

{{=form.custom.end}}


*The problem:*
How can I get image thumbnail in update form? At the moment there is just 
upload field and it looks like no image was uploaded yet. Confusing for the 
user.

Best,
Kristjan

-- 
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] Force include langauge in URL path

2016-10-16 Thread Najtsirk
Hi,

ia have in routes.py:


routers = dict(

# base router
BASE=dict(
default_application='app',
),
app=dict(languages=['en', 'it'], default_language='en')
)


So this works just fine. If I go to my app: http://localhost:8000/app I see 
English site and if I go to http://localhost:8000/app/it is see Italian.

But how can I force language in URLs? So that url will always show 
http://localhost:8000/app/en or http://localhost:8000/app/it and not 
http://localhost:8000/app ?

Is there a web2py way of doing it or this is possible just with writing 
custom logic?

Thanks in advance.

K.

-- 
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] Re: Djano channels

2016-03-20 Thread Najtsirk
Thanks!

On Sunday, 20 March 2016 07:15:11 UTC+1, pbreit wrote:
>
> Have you seen:
>
> https://github.com/web2py/web2py/blob/master/gluon/contrib/websocket_messaging.py
>
> On Thursday, March 17, 2016 at 2:48:08 PM UTC-7, Najtsirk wrote:
>>
>>
>> https://blog.heroku.com/archives/2016/3/17/in_deep_with_django_channels_the_future_of_real_time_apps_in_django
>>
>> Is there anything similar in web2py? 
>>
>> I read about comet messaging.  How these two compare? 
>>
>> Thanks,  
>> Najtsirk
>>
>>

-- 
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] Djano channels

2016-03-19 Thread Najtsirk
https://blog.heroku.com/archives/2016/3/17/in_deep_with_django_channels_the_future_of_real_time_apps_in_django

Is there anything similar in web2py? 

I read about comet messaging.  How these two compare? 

Thanks,  
Najtsirk

-- 
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] Re: Regarding "registration needs verification"

2016-03-14 Thread Najtsirk
Do you get this error at the firs login (when user registers) or at the 
first login?

Because, if you get it after the first login, this is correct behaviour. 
The user has to verify registrations.

On Friday, 11 March 2016 16:21:43 UTC+1, Ramchandra Sharma wrote:
>
> Although the user is registering .While loginging  i get the error 
> "registration needs verification"\
>
> My variables are --
>
> auth.settings.registration_requires_verification = False
> auth.settings.registration_requires_approval=False
> auth.settings.reset_password_requires_verification = True
> auth.settings.login_after_registration = True
>
> can anyone help me please!!!
>

-- 
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] Re: @auth.requires_login() in the model instead of controller

2016-02-18 Thread Najtsirk
If I do understand you correct: you want to have in the same modal form:

   - if the user is logged in: a form for submitting a new Post;
   - if the user is not logged in: a login form.

Is that correct?

On Thursday, 18 February 2016 23:22:19 UTC+1, Ron Chatterjee wrote:
>
> Here in the picture I explained. Once I click on the button, I do display 
> the form in my modal. But that display inside the modal can only be if the 
> user signed in or the request to sign in. If I could do something like this.
>
> def process_form():
>
>form = SQLFORM(db.post).process()
> return locals()
>
> Then I could use @auth.requires_login() on the top of the def. If I do 
> that, then I will need to use load inside myfunction which I don't want to. 
> May be I need to think more..lol
>
>
> On Thursday, February 18, 2016 at 4:04:28 PM UTC-5, Anthony wrote:
>>
>> On Thursday, February 18, 2016 at 3:58:08 PM UTC-5, Ron Chatterjee wrote:
>>>
>>> Yes. Or if there is a way to add @auth.requires_login() to the table 
>>> itself. In other words, SQLFORM will validate if the user is logged in or 
>>> not based on that flag. like requires=IS_NOT_EMPTY(). Similar to that 
>>> requires = IS_LOGGED_IN(). But there isn't anything like that. lol. So, 
>>> yes, I need to work around.
>>>
>>
>> The point is, you want to check for login *before* presenting the form. 
>> In any case, it's trivially easy to add code to check for login before 
>> showing a form, so I don't think it would be all that helpful to build that 
>> functionality into SQLFORM.
>>
>> Anthony
>>
>

-- 
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] Proposal: Documentation in form of a wiki

2015-08-17 Thread Najtsirk
Hi,

I was wondering: would it be ok to have a documentation in form of a wiki 
or something so anybody can contribute to it? And sure...Massimo has to 
confirm it before publishing it.

My idea goes in this way: if i get my problem solved here on google groups, 
I will be willing to contribute a short article to wiki about it. Maybe 
wouldn't be a perfect solutions but somebody else could build upon it and 
make better example.

Best,
Najtsirk

-- 
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] SQLFORM.grid different classes for add and edit forms

2015-08-10 Thread Najtsirk
Hello,

is it possible to assign different classes for add and edit forms in 
SQLFORM.grid?

A this point there is no difference between them so I cannot use proper CSS 
selectors for JS.

Best,
Najtsirk

-- 
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] Re: What if Massimo got hit by a Bus?

2015-06-26 Thread Najtsirk
Massimo got a motorbike. 

On Thursday, 26 May 2011 16:15:17 UTC+2, Bob Blanchett wrote:
>
> I just read this presentation by by GvR/BDFL 
> 
>  
> on 21 years of Python and wondered for Web2py  as  some one did  for 
> Python  
> in 1994.
>
> What if the worst happened to Massimo (God Forbid) ?
>
> The Technology Selection Risks etc etc..
>
> Yours in no way Gruesomely,
>
> Bob
>

-- 
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] Re: Locking app to a single domain

2015-06-10 Thread Najtsirk
If I understand that correctly...that would mean I need to do these all 
combinations for each domain/app?

Is it possible tu use a wildcard for the app part of the routes too? 
Like: (https?://www.domain1.com:\w+ /$*anything*$anything', 
'/app1$anything') ?


On Tuesday, 9 June 2015 00:35:58 UTC+2, Massimo Di Pierro wrote:
>
> I do not know about the router but you can with the pattern based 
> routes.py using the regex notation:
>
> routes_in = (
>  (https?://www.domain1.com:\w+ /app2$anything', '/app1$anything'),
>
> (https?://www.domain2.com:\w+ /app1$anything', '/app2$anything'),
>
> )
>
>
>
>
> On Monday, 8 June 2015 10:56:51 UTC-5, villas wrote:
>>
>> My suggestion does not answer your question,  it merely suggests a 
>> work-around.
>>
>> In a model file e.g. models/0redirects.py  (your first model) check the 
>> domain and app name are correct.  If not,  redirect,  or whatever you wish 
>> to happen.
>>
>> Hopefully,  someone will provide an answer based on routes.py
>>
>> All the best,  D
>>
>>
>> On Friday, 5 June 2015 20:00:29 UTC+1, Najtsirk wrote:
>>>
>>> Did you mean to put this into specific app?
>>>
>>> This does not work, because router redirects to different app.
>>>
>>>
>>> On Friday, 5 June 2015 17:17:48 UTC+2, villas wrote:
>>>>
>>>> Maybe something like this (untested)...
>>>>
>>>> --- in models/0redirects.py ---
>>>> if request.application in ['app2','app3']:
>>>> redirect(URL('index'))
>>>>
>>>>

-- 
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] Re: Locking app to a single domain

2015-06-05 Thread Najtsirk
Did you mean to put this into specific app?

This does not work, because router redirects to different app.


On Friday, 5 June 2015 17:17:48 UTC+2, villas wrote:
>
> Maybe something like this (untested)...
>
> --- in models/0redirects.py ---
> if request.application in ['app2','app3']:
> redirect(URL('index'))
>
>

-- 
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] Locking app to a single domain

2015-06-05 Thread Najtsirk
I have define routes like this:

routers = dict(
  BASE  = dict(
  domains = {
  'domain1.com' : 'app1',
  'domain2.com' : 'app2',
  }
  ),
)

which works OK.

However, there is a thing, that I would like to avoid. 

If i acces: domain1.com/*app2*, i get app2. Is there a way to avoid 
accessing app2 through domain1.com (and vice-versa) in parameter-based 
system?

Best,
Kristjan

-- 
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] Re: How to use record.id in upload path?

2015-06-05 Thread Najtsirk
I know about uploadseparate option. I was looking for kind of solution 
where I could define the folder structure for uploaded files (from 
different forms).

I will try to implement my own logic. Thanks.

Theres

On Monday, 25 May 2015 23:02:09 UTC+2, Anthony wrote:
>
> It looks like each project has only one photo associated with it -- do you 
> really need a separate folder for each project just to store a single 
> photo? If you are worried about OS performance issues with large numbers of 
> files in a single directory, you should instead do:
>
> Field('photo', 'upload', uploadseparate=True, autodelete=True)
>
> web2py will automatically create many sub-folders to divide up the files.
>
> Anyway, what you ask is tricky because the record ID is not known until 
> after a record has been inserted, so instead of relying on web2py's 
> built-in upload mechanism, you would have to manually manage the uploads 
> after record insertion.
>
> Anthony
>
> On Monday, May 25, 2015 at 11:29:54 AM UTC-4, Najtsirk wrote:
>>
>> Dear all,
>>
>> let's say the model is:
>>
>> import os
>>
>> db.define_table('project',
>>  Field('title', 'string'),
>>  Field('photo','upload', 
>> uploadfolder=os.path.join(request.folder,'upload/project/'), 
>> autodelete=True))
>>
>> How can I include record.id in the uploadfolder path so a can have 
>> separatesubfolders, like 
>> os.path.join(request.folder,'upload/project/*$record.id 
>> <http://record.id>*').
>>
>> Best,
>> Kristjan
>>
>

-- 
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] How to use record.id in upload path?

2015-05-25 Thread Najtsirk
Dear all,

let's say the model is:

import os

db.define_table('project',
 Field('title', 'string'),
 Field('photo','upload', 
uploadfolder=os.path.join(request.folder,'upload/project/'), 
autodelete=True))

How can I include record.id in the uploadfolder path so a can have 
separatesubfolders, like os.path.join(request.folder,'upload/project/
*$record.id*').

Best,
Kristjan

-- 
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] Last version of plugin_wiki?

2015-04-07 Thread Najtsirk

Hi guys,

where can I get the latest version of plugin_wiki?

Best,
K

-- 
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] Re: Best way to manage a cart

2015-04-06 Thread Najtsirk
I use session storage for cart until checkout. 

You can find an example from Massimo here:
https://github.com/mdipierro/web2py-appliances/tree/master/EStore

I was studying this before implementing my own solution.

Best,
K. 

On Monday, 6 April 2015 21:08:25 UTC+2, Gael Princivalle wrote:
>
> Hello all.
>
> I've to make a cart.
> I would like to let the user add products to the cart without login.
> Login will be done at checkout.
> I would like to save all carts, so when a user will add the first product, 
> I'll add a record in my cart table.
>
> I'm wondering about how can I manage the fact that I have to reference the 
> auth_user in this cart table, as it will not have done the login?
> I was thinking about creating a dummy user and put his ID temporary in the 
> cart table.
>
> Someone have a suggestion?
>
> Thanks, regards.
>
>
>
>

-- 
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] Re: Is there any example or plugin for threaded comments?

2015-04-01 Thread Najtsirk
Maybe I do not use the right expresion. I want that users can be able to 
reply on comments and that this is shown in kind of a indented layout.

In the redidclone there is a self-referencing field,  but there is no 
implementation in terms of output. I was looking db().select().as_trees() 
implementation, and I can get righ, but I have problem with nested layout 
(I'm using Semantic UI). 

def show(row,n=0):
return ''+row.created_on.strftime("%d. %m. %Y 
ob %H:%M")+''+row.comment+''+''.join(show(c,n+1) for c in row.children)+''

### in model
db.define_table('comment',
Field('comment','text', label='Comment'),
Field('question_id','reference question', readable=False, 
writable=False),
Field('parent_id','reference comment'),
auth.signature,
redesine=True
)


def comments():

db.comments.question_id.default = request.args(0)

form = SQLFORM(db.comment, _class='ui form').process()

form.custom.submit['_class'] = 'ui button'

comments = 
db(db.comment.question_id==request.args(0)).select().as_trees()

result = ''
for c in comments:
result+=''+show(c)+''

return dict(form=form,result=result)



On Wednesday, 1 April 2015 22:37:32 UTC+2, Massimo Di Pierro wrote:
>
> Not as I would do it today but this old app had threaded comments: 
> https://github.com/mdipierro/web2py-appliances/tree/master/RedditClone
>
> On Wednesday, 1 April 2015 15:18:26 UTC-5, Najtsirk wrote:
>>
>> HI,
>>
>> I am searching for the best solution for threaded comments. Do anybody of 
>> you have plugin or at least example of implementation?
>>
>> Best,
>> Kristjan
>>
>

-- 
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] Is there any example or plugin for threaded comments?

2015-04-01 Thread Najtsirk
HI,

I am searching for the best solution for threaded comments. Do anybody of 
you have plugin or at least example of implementation?

Best,
Kristjan

-- 
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] Re: Web2py 2.10.1 error: define_table argument is not a Field or Table

2015-04-01 Thread Najtsirk
That works!Tnx!

On Wednesday, 1 April 2015 14:31:28 UTC+2, rif wrote:
>
> well, what you can try is to get the latest web2py version, unzip it and 
> then copy your apps in your new web2py instance.
>
> It might be something wrong with the update process.
>
> miercuri, 1 aprilie 2015, 15:25:58 UTC+3, Najtsirk a scris:
>>
>> It's not working for me.
>>
>> On Wednesday, 1 April 2015 13:28:38 UTC+2, rif wrote:
>>>
>>> I fixed this by deleting the welcome app and replacing it with the one 
>>> from the latest version.
>>>
>>> miercuri, 1 aprilie 2015, 13:29:24 UTC+3, Najtsirk a scris:
>>>>
>>>> Hi,
>>>>
>>>> i get this error with Web2py 2.10.1 on all applications:
>>>>
>>>> syntaxError: define_table argument is not a Field or Table: .
>>>> is_active
>>>>
>>>> Don't know how to fix it.
>>>>
>>>> Best,
>>>> kristjan
>>>>
>>>

-- 
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] Re: Web2py 2.10.1 error: define_table argument is not a Field or Table

2015-04-01 Thread Najtsirk
It's not working for me.

On Wednesday, 1 April 2015 13:28:38 UTC+2, rif wrote:
>
> I fixed this by deleting the welcome app and replacing it with the one 
> from the latest version.
>
> miercuri, 1 aprilie 2015, 13:29:24 UTC+3, Najtsirk a scris:
>>
>> Hi,
>>
>> i get this error with Web2py 2.10.1 on all applications:
>>
>> syntaxError: define_table argument is not a Field or Table: .
>> is_active
>>
>> Don't know how to fix it.
>>
>> Best,
>> kristjan
>>
>

-- 
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] Web2py 2.10.1 error: define_table argument is not a Field or Table

2015-04-01 Thread Najtsirk
Hi,

i get this error with Web2py 2.10.1 on all applications:

syntaxError: define_table argument is not a Field or Table: .
is_active

Don't know how to fix it.

Best,
kristjan

-- 
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] Re: web2py 2.10.1 is OUT

2015-04-01 Thread Najtsirk


*When I create new simple application, i get this error:*

SyntaxError: define_table argument is not a Field or Table: .is_active


On Wednesday, 1 April 2015 00:26:18 UTC+2, Massimo Di Pierro wrote:
>
> - welcome app defaults to Bootstrap 3
> - DAL -> pyDAL (thanks Giovanni, Niphlod, Paolo)
>   - new modular dal
>   - fixed problems with GAE support
>   - moved to full NDB support
>   - improved connection pooling logic
> - optional cache.ram.max_ram_utilization = 90 (experimental)
> - improved cache.disk logic (thanks Niphlod and Leonel)
> - lots of pep8 improvements, thanks Richard
> - added support for email attchments when auth.settings.server='gae'
> - fixed app.yaml.example for GAE
> - fixed many small issues
> - many many more tests (thanks Giovanni, Niphlod, Paolo)
> - upgrading static libraries (bootstrap, codemirror, jquery, etc)
>
>

-- 
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] Dilemma: how to store reports

2015-03-09 Thread Najtsirk
Dear Web2pyers,

I have dilemma not connected directly to Web2py. I am running / developing 
a web application where different projects seek impact investments and 
donations. Each project is obliged to submit a report by the end of the 
year. 

For the first two years we accepted written reports  in word documents. 
>From this year on we contemplate of e-reporting. So here we face dilemma. I 
have in mind two ways of doing that:

 - define databse schema with all the necessary fields. The problem is what 
if we decide to change schema next year.

 - write report as a xml structured document in our database. 

Which way is better in your opinion?

Best
K

-- 
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] Re: Insert into db.table after user registration

2014-10-08 Thread Najtsirk
Thanks.

On Wednesday, 8 October 2014 15:47:46 UTC+2, Leonel Câmara wrote:
>
> auth.settings.register_onaccept
>

-- 
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] Insert into db.table after user registration

2014-10-08 Thread Najtsirk
Hello,

i would like to insert a record in db.table when a user registration is 
performed. How to achieve that?

Best,
Kristjan

-- 
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] Re: Web2py + AngularJS: routes

2014-08-16 Thread Najtsirk
Cool. How did you manage to get authentication working?

Did you do it on a separate, "non Angular url", like 'default/user'? Did 
you manage to get it with Angular?

Best,

Kristjan

On Saturday, 16 August 2014 15:28:52 UTC+2, dlypka wrote:
>
> I did not put a folder name such as your projects/.
> I kept the html paths flat.
>
> I converted the Angular Store sample to web2py + Angular:
>
> This worked for me:
> var storeApp = angular.module('AngularStore', ['ngRoute', 
> 'angularTreeview']).
>   config(['$routeProvider', function($routeProvider) {
>   $routeProvider.
>   when('/store', {
> templateUrl: 'store.htm',
> controller: storeController 
>   }).
>   when('/products/:productSku', {
> templateUrl: 'product.htm',
> controller: storeController
>   }).
>   when('/cart', {
> templateUrl: 'shoppingCart.htm',
> controller: storeController
>   }).
>   otherwise({
> redirectTo: '/store'
>   });
> }]);
>
> No need to specify index.html anywhere in the routing.
>
> I had a controller angularStore.py and so all the htmls (including 
> index.html) are in folder:
> views/angularStore
>
> On Friday, August 15, 2014 11:59:29 AM UTC-5, Najtsirk wrote:
>>
>> OK, but how do I configure AngularJS routes?
>>
>> For example:
>> App.config(['$routeProvider',
>> function ($routeProvider) {
>> $routeProvider.
>> when('/', {
>> templateUrl: 'index.html',
>> controller: 'IndexCtrl'
>> }).
>> when('/projects', {
>> templateUrl: 'projects/index.html',
>> controller: 'ProjektiCtrl'
>> })
>> }]);
>>
>> How can I get routes to the partiapl templates right? Let's say that 
>> partial template for '/projects' is in views/projects/index.html directory. 
>> What is the right 'templateUrl' for this template?
>>
>> Best,
>> Kristjan
>>
>> On Friday, 15 August 2014 02:58:51 UTC+2, dlypka wrote:
>>>
>>> in the Views folders as usual.
>>>
>>> But then I also had to make controller functions for each .html. For 
>>> example:
>>>
>>> def jqplot():
>>> # This method is necessary to allow views/home/jqplot.html to be 
>>> rendered
>>> response.delimiters = ('{[',']}')
>>> return dict()
>>>
>>> On Thursday, August 14, 2014 3:41:19 PM UTC-5, Najtsirk wrote:
>>>>
>>>> Hello,
>>>>
>>>> i have problem with Web2py and AngularJS regarding routes. Where should 
>>>> be partial .html files of specific routes stored? In static folder? 
>>>>
>>>> Best,
>>>> Kristjan
>>>>
>>>

-- 
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] Re: Web2py + AngularJS: routes

2014-08-15 Thread Najtsirk
OK, but how do I configure AngularJS routes?

For example:
App.config(['$routeProvider',
function ($routeProvider) {
$routeProvider.
when('/', {
templateUrl: 'index.html',
controller: 'IndexCtrl'
}).
when('/projects', {
templateUrl: 'projects/index.html',
controller: 'ProjektiCtrl'
})
}]);

How can I get routes to the partiapl templates right? Let's say that 
partial template for '/projects' is in views/projects/index.html directory. 
What is the right 'templateUrl' for this template?

Best,
Kristjan

On Friday, 15 August 2014 02:58:51 UTC+2, dlypka wrote:
>
> in the Views folders as usual.
>
> But then I also had to make controller functions for each .html. For 
> example:
>
> def jqplot():
> # This method is necessary to allow views/home/jqplot.html to be 
> rendered    
> response.delimiters = ('{[',']}')
> return dict()
>
> On Thursday, August 14, 2014 3:41:19 PM UTC-5, Najtsirk wrote:
>>
>> Hello,
>>
>> i have problem with Web2py and AngularJS regarding routes. Where should 
>> be partial .html files of specific routes stored? In static folder? 
>>
>> Best,
>> Kristjan
>>
>

-- 
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] Web2py + AngularJS: routes

2014-08-14 Thread Najtsirk
Hello,

i have problem with Web2py and AngularJS regarding routes. Where should be 
partial .html files of specific routes stored? In static folder? 

Best,
Kristjan

-- 
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] Re: Powered by Web2py: www.sklad05.si

2014-08-09 Thread Najtsirk


Nothing special. Zurb Foundation. However, this is still a work in 
progress. 





On Saturday, 9 August 2014 17:50:41 UTC+2, Cliff Kachinske wrote:
>
> Very nice. I like the way the pages adapt to changing viewport sizes. Good 
> decision on shrinking the pictures across the top, I think.
>
> If you don't mind my asking, what CSS/javascript magic are you using? Or 
> is it all htm5?
>
> On Saturday, August 9, 2014 11:16:24 AM UTC-4, Najtsirk wrote:
>>
>> Hi,
>>
>> just wanna share my site I've made with web2py www.sklad05.si
>>
>> Best,
>> Kristjan
>>
>

-- 
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] Powered by Web2py: www.sklad05.si

2014-08-09 Thread Najtsirk
Hi,

just wanna share my site I've made with web2py www.sklad05.si

Best,
Kristjan

-- 
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] Re: How can I update a row dynamically from vars?

2014-07-13 Thread Najtsirk
No, this does not work.

Best,
Kristjan

On Sunday, 13 July 2014 08:12:57 UTC+2, Annet wrote:
>
> Doesn't this work?
>
> db.post(id=ID).update_record(FIELD=VALUE)
>
>
> Regards,
>
> Annet
>
>

-- 
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.


Re: [web2py] How can I update a row dynamically from vars?

2014-07-13 Thread Najtsirk
Thanks! This works.

On Sunday, 13 July 2014 04:05:23 UTC+2, viniciusban wrote:
>
> You can create a dict and pass to update: 
>
>  
> def post_update(): 
>   ID = request.vars.id 
>   FIELD = request.vars.field 
>   VALUE = request.vars.value 
>   data = {FIELD: VALUE} 
>
>   db(db.post.id==ID).update(**data) 
>  
>
> Note: this solution is pure Python. No feature from Web2py here. 
>
>
>
>
> On Sat, Jul 12, 2014 at 9:30 PM, Najtsirk  > wrote: 
> > Hi, 
> > 
> > let say that i pass vars id, field & value to a controller. Than I want 
> to 
> > preform an update. 
> > 
> > def post_update(): 
> >   ID = request.vars.id 
> >   FIELD = request.vars.field 
> >   VALUE = request.vars.value 
> > 
> >   db(db.post.id==ID).update(FIELD=VALUE) 
> > 
> > 
> > This, obviously, does not work. How can I achieve that i can dinamically 
> > update records? 
> > 
> > Best, 
> > Kristjan 
> > 
> > 
> > -- 
> > 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+un...@googlegroups.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.
For more options, visit https://groups.google.com/d/optout.


[web2py] How can I update a row dynamically from vars?

2014-07-12 Thread Najtsirk
Hi,

let say that i pass vars id, field & value to a controller. Than I want to 
preform an update.

def post_update():
  ID = request.vars.id
  FIELD = request.vars.field
  VALUE = request.vars.value
  
  db(db.post.id==ID).update(FIELD=VALUE)


This, obviously, does not work. How can I achieve that i can dinamically 
update records?

Best,
Kristjan


-- 
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] Re: SQLFORM does not submit,if displayed over jQuery load

2014-06-10 Thread Najtsirk
Anthony, many thanks!

Can this be achieved also with setting SQLFORM( _action="") attribute?

Best,
Kristjan

On Tuesday, 10 June 2014 15:42:17 UTC+2, Anthony wrote:
>
> The "action" attribute of the form is "#", which means the form will 
> submit to the URL of the parent page. Instead, your form must submit to the 
> edit_posts action, which means you need to trap the form submission and 
> submit it via Ajax as well. The easiest way to do this is to instead put 
> the form in a web2py component:
>
>  Edit 
>
> 
>
> Anthony
>
> On Tuesday, June 10, 2014 2:06:32 AM UTC-4, Najtsirk wrote:
>>
>> Hi,
>>
>> in my default.py i have a simple function:
>>
>> def edit_posts():
>> form=SQLFORM(db.postos, request.args(0)).process()
>> return dict(form=form)
>>
>> On my posts page, i have a table of all posts with a button, that calls a 
>> SQLFORM with a jQuery load, like this:
>>
>>  > onclick="$('.content').load('{{=URL('default' , 'edit_posts', args=
>> post.id)}}');"> Edit 
>>
>> Until here, everything works ok. But the problem is, i canot update a 
>> post over this form.
>>
>> SQLFORM, whic is shown ad default/edit_posts/post.id works without 
>> problem.
>>
>> What am I missing here?
>>
>> Best,
>> Kristjan
>>
>

-- 
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] SQLFORM does not submit,if displayed over jQuery load

2014-06-09 Thread Najtsirk
Hi,

in my default.py i have a simple function:

def edit_posts():
form=SQLFORM(db.postos, request.args(0)).process()
return dict(form=form)

On my posts page, i have a table of all posts with a button, that calls a 
SQLFORM with a jQuery load, like this:

  Edit 

Until here, everything works ok. But the problem is, i canot update a post 
over this form.

SQLFORM, whic is shown ad default/edit_posts/post.id works without problem.

What am I missing here?

Best,
Kristjan

-- 
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] Strange web2py book?

2014-03-23 Thread Najtsirk
Hi,

is something wrong with this chapter?

http://web2py.com/books/default/chapter/29/09/access-control


Kristjan

-- 
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] Re: please help testing windows and mac binary

2014-03-20 Thread Najtsirk
Does not work on Win 7 Home Premium 64-bit

On Thursday, 20 March 2014 17:16:13 UTC+1, Massimo Di Pierro wrote:
>
> problems have been reported with the windows and mac binaries for 2.9.x.
>
> Can you please help?
>
> Download the nightly builds:
> http://web2py.com/examples/static/nightly/web2py_win.zip
> http://web2py.com/examples/static/nightly/web2py_osx.zip
>
> and let us know if they work/do-not-work for you. Which OS version?
>
> 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.
For more options, visit https://groups.google.com/d/optout.


[web2py] Re: list:reference or many-to-many

2014-01-17 Thread Najtsirk
Thanks, Massimo.

On Friday, 17 January 2014 19:12:00 UTC+1, Massimo Di Pierro wrote:
>
> list:reference is faster for finding referenced fields
> many-to-many are faster for finding referencing fields.
>
> Usually categories are nested. I assume you want tags instead of 
> categories (it is more general). I usually use both approaches and 
> de-normalize it. 
>
> Below there is class Tag (which is a little complex but can be used out of 
> the box) and some example of usage:
>
> class Tag(object):
> class Validator(object):
> def __call__(self,values):
> if isinstance(values,str):
> values = values.split(',')
> tags = [IS_SLUG.urlify(x) for x in values]
> tags = [x.lower() for x in tags if x]
> return (tags, None)
> def formatter(self,values):
> return ', '.join(values) if values else ''
> @staticmethod
> def represent(v,r=None):
> return SPAN(*(SPAN(t,_class='tag') for t in v)) if v else ''
>
> @staticmethod
> def after_insert(fields, record_id, field2):
> if 'tags' in fields:
> for tag in fields.tags:
> d = {'name':tag, field2.name:record_id}
> field2.table.insert(**d)
>
> @staticmethod
> def after_update(dbset,fields,field1,field2):
> if 'tags' in fields:
> subquery = dbset._select(field1.table.id)
> field2._db(field2.belongs(subquery)).delete()
> for tag in fields.tags:
> d = {'name':tag, field2.name:record_id}
> field2.table.insert(**d)
>
> @staticmethod
> def connect(field1,name="tag"):
> db = field1._db
> table = 
> db.define_table(name,Field('name'),Field(field1.name,'reference 
> thing'))
> field2 = table[field1.name]
> field1.requires = Tag.Validator
> field1.widget = SQLFORM.widgets.string.widget
> field1.represent = Tag.represent
> field1.table._after_insert.append(lambda f,u: 
> Tag.after_insert(f,u,field2))
> field1.table._after_update.append(lambda f,u: 
> Tag.after_insert(f,u,field1,field2))
>
> @staticmethod
> def has_all(field1,tags,name="tag",mode="and"):
> db = field1._db
> table = db[name]
> if isinstance(tags,str):
> tags = [tags]
> queries = []
> for tag in tags:
> queries.append(field1.table.id.belongs(db(table.name
> ==tag)._select(table[field1.name])))
> if mode=='and':
> return reduce(lambda a,b:a&b, queries)
> else:
> return reduce(lambda a,b:a|b, queries)
>
> @staticmethod
> def has_any(field1,tags,name="tag"):
> return Tag.has_all(field1,tags,name=name,mode="or")
>
> ### example of usage
>
> db.define_table('thing', Field('name'), Field('tags','list:string'))
> Tag.connect(db.thing.tags)
>
> db.thing.insert(name='table', tags=['round','blue'])
> print db(Tag.has_all(db.thing.tags,['round'])).select(db.thing.ALL)
> print db(Tag.has_all(db.thing.tags,['blue'])).select(db.thing.ALL)
> print db(Tag.has_all(db.thing.tags,['red'])).select(db.thing.ALL)
> print db(Tag.has_all(db.thing.tags,['blue', 'round'])).select(db.thing.ALL)
> print db(Tag.has_any(db.thing.tags,['red','round'])).select(db.thing.ALL)
>
> On Friday, 17 January 2014 03:21:52 UTC-6, Najtsirk wrote:
>>
>> Hi,
>>
>> I have a dilemma about *list:reference, multiple=True vs. many-to-many 
>> with intermediate table.*
>>
>> I have Projects which haveto be in several categories. 
>>
>> Is it better to use list:reference (to list categories from the 
>> categories table) or many-to-many? Which is faster in queries?
>>
>> Thanks for the answers.
>>
>

-- 
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/groups/opt_out.


[web2py] list:reference, multiple=True vs. many-to-many with intermediate table

2014-01-17 Thread Najtsirk
Hi,

I have a dilemma about *list:reference, multiple=True vs. many-to-many with 
intermediate table.*

I have Projects which haveto be in several categories. 

Is it better to use list:reference (to list categories from the categories 
table) or many-to-many? Which is faster in queries?

Thanks for the answers.

-- 
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/groups/opt_out.


[web2py] Re: Redactor, request.post_vars, $_FILES['file']

2013-07-13 Thread Najtsirk
*coresponds

On Sunday, 14 July 2013 02:06:16 UTC+2, Najtsirk wrote:
>
> Hi,
>
> I am struggling with implementation of image upload in Redactor wysiwyg.
>
> Does $FILES['file']['type'] corsponfs to request.post_vars.file.type ?
>
> Thanks for the anwser.
>
> Najtsirk
>

-- 

--- 
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/groups/opt_out.




[web2py] Redactor, request.post_vars, $_FILES['file']

2013-07-13 Thread Najtsirk
Hi,

I am struggling with implementation of image upload in Redactor wysiwyg.

Does $FILES['file']['type'] corsponfs to request.post_vars.file.type ?

Thanks for the anwser.

Najtsirk

-- 

--- 
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/groups/opt_out.




[web2py] How to eliminate app name from the url?

2013-04-06 Thread Najtsirk
Hi,

i used Jonathan's suggestion about url redirection from 'www.domain.com' to 
'domain.com'.

In routes.py i set:

routers = dict(

# base router
BASE=dict(
default_application='welcome',
domains = {
'domain.com' : 'myapp',
'www.domain.com' : 'myapp',
}
),
)


In myapp's model 0.py i set:

if request.env.http_host == 'www.domain.com':
redirect("http://domain.com%s"; % request.env.request_uri, 301)


The problem is that:
 

 'www.domain.com' returns 'domain.com/myapp/controller/funcion/'


and i would like to get rid of 'myapp' in url.

How can i achieve that?

Best,
Kristjan 

-- 

--- 
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/groups/opt_out.




[web2py] Re: weird behavior in crud update

2012-07-24 Thread Najtsirk
Nop, nothing like that.

Ok, now the behavior is changed. The problem persists just with the boolean 
(when I set it to False...i have to submit twice). Text fields are ok now. 
It's funny, because i have very straightforward app.

Model:
db.define_table('blog',
Field('naslov','string',label='Naslov'),
Field('slug','string',label='Strojno ime'),
Field('uvod','text',label='Uvod'),
Field('vsebina','text',label='Vsebina'),
Field('objavljeno','boolean',label='Objavljeno', default=False),
Field('datum','datetime',default=request.now),
format = lambda r: r.naslov)

Controller:
@auth.requires_membership('admin')
def uredi():

form = SQLFORM(db.blog, record=request.args(0)).process()

return dict(form=form)

View:
{{extend 'layoutno.html'}} 


textarea {width: 400px !important;}
textarea#blog_vsebina {width: 650px !important;}
.alert input {width: 150px !important;}




Uredi blog zapis

{{=form}}




On Monday, 23 July 2012 23:55:49 UTC+2, Najtsirk wrote:
>
> Hi,
>
> each time i want to update crud, i have to submit changes twice to get it 
> actually updated.
>
> I set crud.settings.detect_record_change = False, which helps with 'text' 
> fields, but the problem presists with 'boolean'. Boolean field get changed 
> each time i update form, even though I do not change it. 
>
> I'm getting this on 1.99.4 and on 1.99.7.
>
> I'm seeing this for the first time, but then againi'm doing Blog app 
> for the first time and there is a little more updating than in my other 
> apps.
>
> Any clues?
>
> Best,
> Kristjan
>
>
>

-- 





[web2py] Re: weird behavior in crud update

2012-07-24 Thread Najtsirk
I still have the same strange behaviour with SQLFORM.process().


On Monday, 23 July 2012 23:55:49 UTC+2, Najtsirk wrote:
>
> Hi,
>
> each time i want to update crud, i have to submit changes twice to get it 
> actually updated.
>
> I set crud.settings.detect_record_change = False, which helps with 'text' 
> fields, but the problem presists with 'boolean'. Boolean field get changed 
> each time i update form, even though I do not change it. 
>
> I'm getting this on 1.99.4 and on 1.99.7.
>
> I'm seeing this for the first time, but then againi'm doing Blog app 
> for the first time and there is a little more updating than in my other 
> apps.
>
> Any clues?
>
> Best,
> Kristjan
>
>
>

-- 





[web2py] Re: weird behavior in crud update

2012-07-24 Thread Najtsirk
Crud is much quicker to implement then SQLFORM (or maybe i just do not 
understand it and I'm wrong on that). This was cool for the purpose of 
making web app prototypes.

But i agree on the principle to go with one (and better) tool.

Thanks for explanation.

Kristjan


On Monday, 23 July 2012 23:55:49 UTC+2, Najtsirk wrote:
>
> Hi,
>
> each time i want to update crud, i have to submit changes twice to get it 
> actually updated.
>
> I set crud.settings.detect_record_change = False, which helps with 'text' 
> fields, but the problem presists with 'boolean'. Boolean field get changed 
> each time i update form, even though I do not change it. 
>
> I'm getting this on 1.99.4 and on 1.99.7.
>
> I'm seeing this for the first time, but then againi'm doing Blog app 
> for the first time and there is a little more updating than in my other 
> apps.
>
> Any clues?
>
> Best,
> Kristjan
>
>
>

-- 





[web2py] weird behavior in crud update

2012-07-23 Thread Najtsirk
Hi,

each time i want to update crud, i have to submit changes twice to get it 
actually updated.

I set crud.settings.detect_record_change = False, which helps with 'text' 
fields, but the problem presists with 'boolean'. Boolean field get changed 
each time i update form, even though I do not change it. 

I'm getting this on 1.99.4 and on 1.99.7.

I'm seeing this for the first time, but then againi'm doing Blog app 
for the first time and there is a little more updating than in my other 
apps.

Any clues?

Best,
Kristjan


-- 





[web2py] Re: A database design dillema

2012-07-12 Thread Najtsirk
Thanks guys for your help. I went with Villas/Anthony's idea.

On Thursday, 12 July 2012 00:47:06 UTC+2, Najtsirk wrote:
>
> Hello,
>
> I have a database design dilema. I want to do a e-learning system for a 
> course. The course soould have severeal lessons, each lesson can be of 
> different type.
>
> Let's say we have following model:
>
> #for definiton of each course
> db.define_table('course',
>
> Field('title', 'string')) 
>
>  
>
>
> #for the video lesson
> db.define_table('video',
>
> Field('title', 'string'),
>
> Field('video_url', 'string'),
>
> Field('course_id', db.course),
>
> Field('weight', 'integer'))
>
>
> #for the tekst lesson
> db.define_table('text',
>
> Field('title', 'string'),
>
> Field('content', 'text'),
>
> Field('course_id', db.course),
>
> Field('weight', 'integer'))
>
>
> I know how to do this with a raw sql using UNION, like:
>
> db.executesql('SELECT title, course_id, weight FROM video UNION SELECT 
> title, course_id, weight FROM text WHERE course_id = *some_value* ORDER 
> BY weight')
>
> But i wondering if there is any way I can achieve that with DAL? Maybe I 
> should design the database model in a different way?
>
> Thank you for your replies, ideas, thoughts..
>
> Kristjan
>
>  
>
>
>  
>


[web2py] Re: A database design dillema

2012-07-12 Thread Najtsirk
I did manage to do this on my own. But the problem is ordering. I cannot 
get the records in the right order.

I did manage to get the rows like:

Table 1 - Record 1
Table 1 - Record 2
Table 1 - Record 3
Table 2 - Record 1
Table 2 - Record 2
Table 2 - Record 3

But how can i get output orderd by weight (which is a integer field in both 
tables), like:

Table 1 - Record 2 - Weight 1
Table 2 - Record 3 - Weight 2
Table 2 - Record 1 - Weight 3
Table 1 - Record 3 - Weight 4
Table 2 - Record 2 - Weight 5
Table 1 - Record 1 - Weight 6



On Thursday, 12 July 2012 13:31:49 UTC+2, villas wrote:
>
> I forgot that you need to add different tables,  try something like this 
> instead...
>
> a=db.auth_user.with_alias('a')
> r1 = db(a.id==1).select(a.id)
>
> a=db.auth_group.with_alias('a')
> r2 = db(a.id==1).select(a.id)
>
> rows_all = r1 & r2
>
>

[web2py] Re: A database design dillema

2012-07-12 Thread Najtsirk
I was trying to do that, but i just can't figure out how to put rows from 
separate queries together.

On Thursday, 12 July 2012 12:18:12 UTC+2, villas wrote:
>
> If you don't want to use a union query,  how about using separate queries 
> and adding the rows together?
>
>
> On Thursday, July 12, 2012 10:13:57 AM UTC+1, Najtsirk wrote:
>>
>> I plan to have homeworks also, which would have different data model than 
>> content course. I would like to put everything in the same timeline, 
>> whether is a course content (text, video) or  course homework 
>> (questionnaires, uploads etc.).
>>
>> Let say steps 1-5 are course contents and than step 6 is homework, than 
>> steps 7-12 are contents, step 13 homework etc.
>>
>> On Thursday, 12 July 2012 04:59:18 UTC+2, pbreit wrote:
>>>
>>> I don't see any reason to have more than one table "course" at this 
>>> point. Just add a course_type=video|text (I don't think you can name a 
>>> field "type").
>>
>>

[web2py] Re: A database design dillema

2012-07-12 Thread Najtsirk
I plan to have homeworks also, which would have different data model than 
content course. I would like to put everything in the same timeline, 
whether is a course content (text, video) or  course homework 
(questionnaires, uploads etc.).

Let say steps 1-5 are course contents and than step 6 is homework, than 
steps 7-12 are contents, step 13 homework etc.

On Thursday, 12 July 2012 04:59:18 UTC+2, pbreit wrote:
>
> I don't see any reason to have more than one table "course" at this point. 
> Just add a course_type=video|text (I don't think you can name a field 
> "type").



[web2py] Re: A database design dillema

2012-07-11 Thread Najtsirk
Can i achieve that with joins?

On Thursday, 12 July 2012 01:20:50 UTC+2, Najtsirk wrote:
>
> Yeah...i noticed that from your previous answers :)
>
> But...what my other options?
>
> On Thursday, 12 July 2012 01:13:06 UTC+2, Massimo Di Pierro wrote:
>>
>> Not in a single query using dal. And to tell you the truth I do not like 
>> union too much. :-(
>>
>>
>>
>> On Wednesday, 11 July 2012 17:47:06 UTC-5, Najtsirk wrote:
>>>
>>> Hello,
>>>
>>> I have a database design dilema. I want to do a e-learning system for a 
>>> course. The course soould have severeal lessons, each lesson can be of 
>>> different type.
>>>
>>> Let's say we have following model:
>>>
>>> #for definiton of each course
>>> db.define_table('course',
>>>
>>> Field('title', 'string')) 
>>>
>>>  
>>>
>>>
>>> #for the video lesson
>>> db.define_table('video',
>>>
>>> Field('title', 'string'),
>>>
>>> Field('video_url', 'string'),
>>>
>>> Field('course_id', db.course),
>>>
>>> Field('weight', 'integer'))
>>>
>>>
>>> #for the tekst lesson
>>> db.define_table('text',
>>>
>>> Field('title', 'string'),
>>>
>>> Field('content', 'text'),
>>>
>>> Field('course_id', db.course),
>>>
>>> Field('weight', 'integer'))
>>>
>>>
>>> I know how to do this with a raw sql using UNION, like:
>>>
>>> db.executesql('SELECT title, course_id, weight FROM video UNION SELECT 
>>> title, course_id, weight FROM text WHERE course_id = *some_value* ORDER 
>>> BY weight')
>>>
>>> But i wondering if there is any way I can achieve that with DAL? Maybe I 
>>> should design the database model in a different way?
>>>
>>> Thank you for your replies, ideas, thoughts..
>>>
>>> Kristjan
>>>
>>>  
>>>
>>>
>>>  
>>>
>>

[web2py] Re: A database design dillema

2012-07-11 Thread Najtsirk
Yeah...i noticed that from your previous answers :)

But...what my other options?

On Thursday, 12 July 2012 01:13:06 UTC+2, Massimo Di Pierro wrote:
>
> Not in a single query using dal. And to tell you the truth I do not like 
> union too much. :-(
>
>
>
> On Wednesday, 11 July 2012 17:47:06 UTC-5, Najtsirk wrote:
>>
>> Hello,
>>
>> I have a database design dilema. I want to do a e-learning system for a 
>> course. The course soould have severeal lessons, each lesson can be of 
>> different type.
>>
>> Let's say we have following model:
>>
>> #for definiton of each course
>> db.define_table('course',
>>
>> Field('title', 'string')) 
>>
>>  
>>
>>
>> #for the video lesson
>> db.define_table('video',
>>
>> Field('title', 'string'),
>>
>> Field('video_url', 'string'),
>>
>> Field('course_id', db.course),
>>
>> Field('weight', 'integer'))
>>
>>
>> #for the tekst lesson
>> db.define_table('text',
>>
>> Field('title', 'string'),
>>
>> Field('content', 'text'),
>>
>> Field('course_id', db.course),
>>
>> Field('weight', 'integer'))
>>
>>
>> I know how to do this with a raw sql using UNION, like:
>>
>> db.executesql('SELECT title, course_id, weight FROM video UNION SELECT 
>> title, course_id, weight FROM text WHERE course_id = *some_value* ORDER 
>> BY weight')
>>
>> But i wondering if there is any way I can achieve that with DAL? Maybe I 
>> should design the database model in a different way?
>>
>> Thank you for your replies, ideas, thoughts..
>>
>> Kristjan
>>
>>  
>>
>>
>>  
>>
>

[web2py] A database design dillema

2012-07-11 Thread Najtsirk
Hello,

I have a database design dilema. I want to do a e-learning system for a 
course. The course soould have severeal lessons, each lesson can be of 
different type.

Let's say we have following model:

#for definiton of each course
db.define_table('course',

Field('title', 'string')) 

 


#for the video lesson
db.define_table('video',

Field('title', 'string'),

Field('video_url', 'string'),

Field('course_id', db.course),

Field('weight', 'integer'))


#for the tekst lesson
db.define_table('text',

Field('title', 'string'),

Field('content', 'text'),

Field('course_id', db.course),

Field('weight', 'integer'))


I know how to do this with a raw sql using UNION, like:

db.executesql('SELECT title, course_id, weight FROM video UNION SELECT 
title, course_id, weight FROM text WHERE course_id = *some_value* ORDER BY 
weight')

But i wondering if there is any way I can achieve that with DAL? Maybe I 
should design the database model in a different way?

Thank you for your replies, ideas, thoughts..

Kristjan

 


 


[web2py] Re: crud.create causes an id problem

2012-05-12 Thread Najtsirk
I'm not too good at this stuff...but i think i had similar problem.

In my controller I set the default value for the crud.create reference 
field:

db.table.referenceid.default = request.args(0)

form=crud.create(db.table)


I solved the problem with:
 

 db.table.referenceid.default = *int*(request.args(0))




On Thursday, 5 April 2012 10:38:38 UTC+2, Sundar wrote:
>
> I migrated an application running in 1.94.6 to 1.99.7.
>
> I have a peculiar problem. Crud.create on normal tables work. But whenever 
> I apply crud.create on children table (that is there is a foreign key in 
> the table; of course, I set a default value for this key before calling 
> crud.create), I get the error message 
>
>  '_id'
> on the line containing the crud.create statement.
>
>
>
> Do you think I am doing anything wrong?
>
> Thanks and regards
>
> Sundar
>
> ps: If you require the trace, here it is:
>
> File "E:/web2py1.99.7Source/applications/rsi_in1/controllers/fs.py" 
> , line 492, in 
> rinvdetadd
> form = crud.create(db.fs_reimbinvcovers,next=URL(f='rinvview', 
> vars=dict(id=id)))
>   File "E:\web2py1.99.7Source\gluon\tools.py", line 3172, in create
> formname=formname,
>   File "E:\web2py1.99.7Source\gluon\tools.py", line 3089, in update
> separator=self.settings.label_separator
>   File "E:\web2py1.99.7Source\gluon\sqlhtml.py", line 868, in __init__
> inp = self.widgets.options.widget(field, default)
>   File "E:\web2py1.99.7Source\gluon\sqlhtml.py", line 216, in widget
> options = requires[0].options()
>   File "E:\web2py1.99.7Source\gluon\validators.py", line 465, in options
> self.build_set()
>   File "E:\web2py1.99.7Source\gluon\validators.py", line 452, in build_set
> records = self.dbset(table).select(*fields, **dd)
>   File "E:\web2py1.99.7Source\gluon\dal.py", line 7540, in __call__
> query = query._id>0
>   File "E:\web2py1.99.7Source\gluon\dal.py", line 6774, in __getattr__
> return self[key]
>   File "E:\web2py1.99.7Source\gluon\dal.py", line 6714, in __getitem__
> return dict.__getitem__(self, str(key))
> KeyError: '_id'
>
>

[web2py] Forwarding domain to a port

2012-01-12 Thread Najtsirk
Hi everybody,

I successfully instaled web2py on my VPS. However, I have problem to 
forward my domain to port 8000. I can access web2py at 
www.mydomain.com:8000/welcome. How can I  forward domain so that 
www.mydomain.com will actually show www.mydomain.com:8000/welcome?

Best,
Najtsirk