I just found out that the error was because I was having a null variable instead of an image in one of the lines. I still can't figure out how I can't have the Field(author, reference auth_user work.
On Wed, Mar 4, 2020, 13:30 Maurice Waka <mauricew...@gmail.com> wrote: > I've done some look up into the code, did some changes and checked how it > behaves. > > I noted, that using the same code....something is not right with the > author field. > See the screen shot, the author is not posting but the rest of info is > posting. I used the sqlite browser to check the messages. > This is the current error i'm now getting with the same code. > def index(): > ...code here... > r = []#info will be posted here > codes = [] > del codes[:] > > form = FORM(INPUT(_name='message'), INPUT(_type='submit')) > if request.POST.vars: > r.append(request.POST.message) > codes.append(r[0]) > rows = db(db.posts.author== auth.user_id).select() > for row in rows: > row.update_record(message=codes[0]) > name3 = request.GET.message > db.answers.insert(quest=name3, message = report())#, file=photos) > db.posts.insert(message = report()) > ####>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>RETRIEVE > MESSAGES<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< > ##replies = db(db.answers.author == > auth.user_id).select(orderby=~db.answers.created_on, limitby=(0,10)) > replies = db(db.answers).select(orderby=~db.answers.created_by, > limitby=(0,10)) > return dict(name3=name3, replies=replies) > > template: > [[extend 'layout.html']] > [[import datetime]] > [[from yatl.helpers import A, TEXTAREA, INPUT, TR, TD, TABLE, DIV, LABEL, > FORM, SELECT, OPTION, P, H1, H2, H3, H4, H5, HTML, BODY, META]] > > <body> > <div class="chat_window" id="a2"> > <ul class="messages"> > [[for reply in replies:]] > <li class="message right appeared"> > <div>[[=reply.modified_on]]</div> > <div class="text_wrapper"> > <div class="text">[[=XML(reply.quest, > sanitize=True)]]</div> > > </div> > </li> > Error message: > > Traceback (most recent call last): > File "/home/maurice/py4web/py4web/core.py", line 551, in wrapper > ret = func(*func_args, **func_kwargs) > File "/home/maurice/py4web/py4web/core.py", line 514, in wrapper > ret = obj.transform(ret) > File "/home/maurice/py4web/py4web/core.py", line 300, in transform > reader=Template.reader, > File "/home/maurice/.local/lib/python3.6/site-packages/yatl/template.py", > line 968, in render > exec(code, context) > File "<string>", line 39, in <module> > TypeError: URL() got an unexpected keyword argument 'args' > > > > On Wed, Mar 4, 2020 at 12:46 AM Dave S <snidely....@gmail.com> wrote: > >> >> >> On Tuesday, March 3, 2020 at 2:08:27 AM UTC-8, Maurice Waka wrote: >>> >>> Any help on this please ? >>> >>> On Friday, February 28, 2020 at 9:29:01 PM UTC+3, Maurice Waka wrote: >>>> >>>> I'm still learning a lot from py4web.....especially not being a >>>> programmer myself, and I appreciate a lot from the help I get from you ALL. >>>> >>>> Anyway, I managed o create the tables and controller functions but I >>>> note that I'm not able to post to the database, at the same time, I cant >>>> see the messages on the index page..this code works well in web2py. I hope >>>> I have posted all relevant info. >>>> >>>> >> [much snipped] >> >> Okay, you've posted what you don't see happening. What happens instead? >> Are there errors? Unexpected output? Have you examined the response using >> the browser tools? Have you added any logging on the server side? >> >> If there are any relevant screen shots, it would be okay to include those. >> >> Oh, and since you say this works with web2py, are you using the same >> client-side code in both cases? That the difference is all server side? >> >> /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 a topic in the >> Google Groups "web2py-users" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/web2py/cneqSQXGacE/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> web2py+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/web2py/9fa18a69-4d5c-4339-896e-41ce795c2e96%40googlegroups.com >> <https://groups.google.com/d/msgid/web2py/9fa18a69-4d5c-4339-896e-41ce795c2e96%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > 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/CALkNK57StytFMf05toP5E1-tMVYDQqnEzkYC7zRMHXAC57simA%40mail.gmail.com > <https://groups.google.com/d/msgid/web2py/CALkNK57StytFMf05toP5E1-tMVYDQqnEzkYC7zRMHXAC57simA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- 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/CAAcHJF80nxbuc2ogn7_2RKBoa7EmAtv5cYNRf_A%2BjjPHJz4ynw%40mail.gmail.com.