Re: [web2py] Two SQLFORMs side by side?
For calendar, go in static calendar.css and set a higher z-index value like 1... Richard On Mon, May 18, 2015 at 12:47 PM, LoveWeb2py atayloru...@gmail.com wrote: Richard, Thank you for your help. I've finally got it figured out and its working great! One thing I have noticed is that for long SQLFORMs my calendar doesn't hook to the fields and I have to scroll up with the modal open to see the calendar picker. I'm guessing this has something to do with CSS and I'm working on it now. I'll create a new dummy app when finished. Thank you so much for your help! On Monday, May 18, 2015 at 10:09:21 AM UTC-4, Richard wrote: Ron, are you saying that there is some kind of malware in dummy app? Richard On Fri, May 15, 2015 at 11:47 PM, Ron Chatterjee achatte...@gmail.com wrote: Caveat to that, is there a way to have to SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its one to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) By the way, this app thats call web2py.app.dummy.w2p, please be aware that it has some nasty nested stuff in it. Once I installed it was crawling all over desktop and wouldn't uninstall except from the DOS mode. Not fair. On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('',
Re: [web2py] Two SQLFORMs side by side?
Ron, are you saying that there is some kind of malware in dummy app? Richard On Fri, May 15, 2015 at 11:47 PM, Ron Chatterjee achatterjee...@gmail.com wrote: Caveat to that, is there a way to have to SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its one to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) By the way, this app thats call web2py.app.dummy.w2p, please be aware that it has some nasty nested stuff in it. Once I installed it was crawling all over desktop and wouldn't uninstall except from the DOS mode. Not fair. On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){
Re: [web2py] Two SQLFORMs side by side?
No. Its all good. I got it figured out. Sorry about that. On Monday, May 18, 2015 at 10:09:21 AM UTC-4, Richard wrote: Ron, are you saying that there is some kind of malware in dummy app? Richard On Fri, May 15, 2015 at 11:47 PM, Ron Chatterjee achatte...@gmail.com javascript: wrote: Caveat to that, is there a way to have to SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its one to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) By the way, this app thats call web2py.app.dummy.w2p, please be aware that it has some nasty nested stuff in it. Once I installed it was crawling all over desktop and wouldn't uninstall except from the DOS mode. Not fair. On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white' ), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){
Re: [web2py] Two SQLFORMs side by side?
Richard, Thank you for your help. I've finally got it figured out and its working great! One thing I have noticed is that for long SQLFORMs my calendar doesn't hook to the fields and I have to scroll up with the modal open to see the calendar picker. I'm guessing this has something to do with CSS and I'm working on it now. I'll create a new dummy app when finished. Thank you so much for your help! On Monday, May 18, 2015 at 10:09:21 AM UTC-4, Richard wrote: Ron, are you saying that there is some kind of malware in dummy app? Richard On Fri, May 15, 2015 at 11:47 PM, Ron Chatterjee achatte...@gmail.com javascript: wrote: Caveat to that, is there a way to have to SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its one to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) By the way, this app thats call web2py.app.dummy.w2p, please be aware that it has some nasty nested stuff in it. Once I installed it was crawling all over desktop and wouldn't uninstall except from the DOS mode. Not fair. On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white' ), CAT(' '), STRONG(T('Add'))), _type='submit',
Re: [web2py] Two SQLFORMs side by side?
That model file is same as this tutorial btw. http://docs.mongodb.org/manual/tutorial/write-a-tumblelog-application-with-django-mongodb-engine/ But instead of mongo, it uses relational database. Wondering what the web2py expert says in implementing this similar to how django admin does. On Friday, May 15, 2015 at 11:47:31 PM UTC-4, Ron Chatterjee wrote: Caveat to that, is there a way to have two SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its many to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. If django can do this, why can we in web2py? class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \
Re: [web2py] Two SQLFORMs side by side?
Caveat to that, is there a way to have to SQLFORM top and bottom like the picture attached? Its more like a django kind of admin panel feature. But in web2py, can we have the post and comment (two tables), embedded so when someone click on the blue plus sign a comment box shows up and people insert the comment on each post. Its one to many relationship (like attached picture). If someone really trying to know what I mean by that, here is the class definition generated for django. class Post(models.Model): created_at = models.DateTimeField(auto_now_add=True, db_index=True) title = models.CharField(max_length=255) slug = models.SlugField() body = models.TextField() comments = models.ManyToManyField('Comment') def get_absolute_url(self): return reverse('post', kwargs={slug: self.slug}) def __unicode__(self): return self.title class Meta: ordering = [-created_at] class Comment(models.Model): created_at = models.DateTimeField(auto_now_add=True) body = models.TextField(verbose_name=Comment) author = models.CharField(verbose_name=Name, max_length=255) By the way, this app thats call web2py.app.dummy.w2p, please be aware that it has some nasty nested stuff in it. Once I installed it was crawling all over desktop and wouldn't uninstall except from the DOS mode. Not fair. On Thursday, May 14, 2015 at 3:53:15 PM UTC-4, LoveWeb2py wrote: No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function ()
Re: [web2py] Two SQLFORMs side by side?
No problem, Richard. Thank you for your help! On Thursday, May 14, 2015 at 11:45:28 AM UTC-4, Richard wrote: No time to hunt the issue with multiples loading... I guess it could come from not using the same web2py version... Or because I made some change over app files which are binded to web2py version /statis/js/web2py.js for instance... or views/web2py_ajax.html You have at least an semi-working example... There is 2 issues that remain : 1) The component load the whole site which he shouldn't (that may be related to the second issue), 2) When you access the http://hostname/appname/second_table_form/second_table there is a weird issue with LOAD... I may have more time next week, but for now, I can't help you further... Richard On Tue, May 12, 2015 at 11:11 AM, LoveWeb2py atayl...@gmail.com javascript: wrote: Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading
Re: [web2py] Two SQLFORMs side by side?
Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayloru...@gmail.com wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \
Re: [web2py] Two SQLFORMs side by side?
Repeating load might be because I extended the layout in the view for the load. On Tuesday, May 12, 2015 at 10:22:41 AM UTC-4, Richard wrote: Almost there... I make it works, but there is something weird going on related to component... I have to figure it out... But you were doing thing the wrong way basically... add_function is for the main_table which contains the city name... I will send you back the corrected app when I found the issue with the repeating load... Richard On Mon, May 11, 2015 at 4:39 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {'
Re: [web2py] Two SQLFORMs side by side?
Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator =separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, #
Re: [web2py] Two SQLFORMs side by side?
The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayloru...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field= db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that
Re: [web2py] Two SQLFORMs side by side?
I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayloru...@gmail.com wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4,
Re: [web2py] Two SQLFORMs side by side?
No rush, Richard. Thank you for your help I really appreciate it. On Monday, May 11, 2015 at 4:34:14 PM UTC-4, Richard wrote: I will try to review it ASAP... On Mon, May 11, 2015 at 4:30 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Here is my dummy app, Richard. On Monday, May 11, 2015 at 3:50:20 PM UTC-4, Richard wrote: Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayl...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's
Re: [web2py] Two SQLFORMs side by side?
Did you make dummy app for testing it? Please attach it here and I have a look to your code... I can't help much if I don't have a good idea of what you have done... new_exp_num=form.vars.exp_num This is something I left which should be adapted to your app... form.vars.exp_num is the representation of the new inputed record... The same field name you specify in the widget declaration for the field attribute : db.table.representing_field, but that you get from the form of the referenced table. Richard On Mon, May 11, 2015 at 3:28 PM, LoveWeb2py atayloru...@gmail.com wrote: Thanks haha. Just checking. Still not having much luck. I'm getting a 500 error on the add function and can't figure out why when I try to edit my site I am getting an error for the add function specified to add the https://www.mywebsite.com/add_function/second_table_field def add_function(): Modal form for adding element buttons = [TAG.button((I('', _class='icon-ok icon-large icon-white'), CAT(' '), STRONG(T('Add'))), _type='submit', _class='btn btn-small btn-primary', _id='add_button_id', _name='add_button', )] form = SQLFORM(db.table, buttons=buttons, formstyle=formstyle, separator=separator) response.js = '$(document).ready(function(){ $(.input_wrapper).has(.error).addClass(inputError); ' \ '$(.w2p_fw).has(.error).addClass(control-group error); ' \ '$(.w2p_fw).each(function(){ $(this).find(.error_wrapper).appendTo(this); }); });' response.js += '$(document).ready(function(){ $(textarea).elastic(); });' response.js += '$(document).ready(function () { $([rel=tooltip]).tooltip(); });' if form.process(formname='add_form').accepted: response.flash = T(Added) target = request.args(0) # close modal response.js = '$(#{target}_modal-form).modal(hide);'.format( target=target) # update the select options response.js += $(#{target}).append( option value='{new_id}' {new_id} /option);.format(target=target, new_id= form.vars.id) # select newly added option response.js += $(#{target}).val({new_exp_num}); $('#{target}').keyup(); $('#{target}').blur(); .format(target=target, new_exp_num=form.vars.exp_num) elif form.errors: response.flash = '' else: response.flash = '' return dict(form=form) Do I need to actually specify the db.table? From the looks of the class I thought it would be defined on its own... am I wrong? Sorry for asking so many questions. I think this will be really helpful when it's all finished. On Monday, May 11, 2015 at 2:59:21 PM UTC-4, Richard wrote: The commented lines in the class was there because I recently refactor it to make it use boostrap modal instead of jquery ui dialog as you may understand carefully reading the code!! :-P Richard On Mon, May 11, 2015 at 2:40 PM, LoveWeb2py atayl...@gmail.com wrote: Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going
Re: [web2py] Two SQLFORMs side by side?
Are the commented lines necessary or was that for self reference? # js += '$(#%s_option_add_trigger). click(function() {' \ # '$(#%s_dialog-form).dialog(open);' \ # 'return false;' \ # '}); ' % (my_select_id, my_select_id) On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com javascript: wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field= db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a
Re: [web2py] Two SQLFORMs side by side?
Okay... must be something on my end. I'm getting Filaed to load resourrce: the server responded with a status of 500 (INTERNAL SERVER ERROR) http;//www.mysite.com/myapp/controller/add_function/name_of_table_field I'll keep playing around with it and let you know how it turns out. Thank you so much, Richard! On Thursday, May 7, 2015 at 9:33:28 AM UTC-4, Richard wrote: you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayl...@gmail.com javascript: wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field= db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM
Re: [web2py] Two SQLFORMs side by side?
Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field=db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title =
Re: [web2py] Two SQLFORMs side by side?
you need bootstrap 2.3.2 (not tested with BS3, but I am pretty sure it is not working, too differents)... Did you try it with a recent web2py setup? I would suggest you try with web2py 2.9.5 which is what I use actually and it works... Richard On Thu, May 7, 2015 at 9:20 AM, LoveWeb2py atayloru...@gmail.com wrote: Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field=db.main_table.id , limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption
Re: [web2py] Two SQLFORMs side by side?
Another observation: All of this code: js += '$(function() {' \ '$(#%s_option_add_trigger).button({' \ 'text: true,' \ 'icons: {' \ 'primary: ui-icon-circle-plus' \ '}' \ '});' \ '});' % (my_select_id) js += '$(function() { ' \ '$( #%s_option_add_trigger ).css(margin-left, +=5); ' \ '});' % (my_select_id) js += '$(#{modal_id}).appendTo(body);'.format(modal_id=my_select_id + _modal-form) Get's commented out when it's rendered so it ends up looking like this !-- $(document).read(function() .appendTo(body);}); //-- Any idea why that could be happening and would that impact the button showing the modal On Thursday, May 7, 2015 at 8:45:49 AM UTC-4, LoveWeb2py wrote: Hi Richard! I think I'm getting close. No more errors, and I applied the widget to the field successfully. I see the + sign next to my field, but nothing happens when I click it so I'm going over the javascript with a fine tooth comb. Is there any additional .js or .css files I need to include? This is really looking promising! On Wednesday, May 6, 2015 at 12:42:34 PM UTC-4, Richard wrote: Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field=db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayl...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, #
Re: [web2py] Two SQLFORMs side by side?
The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayloru...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title = current.T('Add New') else: self.form_title = current.T(form_title) if button_text is None: self.button_text = current.T('Add') else: self.button_text = current.T(button_text) self.dialog_width = dialog_width self.controller = controller self.function = function # -- def callback(self): if self.keyword in self.request.vars: field = self.fields[0] rows = self.db(field.like(self.request.vars[self.keyword]+'%') ).select(orderby=self.orderby, limitby=self.limitby, *self.fields) if rows: if self.is_reference: id_field = self.fields[1] raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _value=s[id_field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, '') def __call__(self, field, value, **attributes): # -- # From : SelectOrAddOption my_select_id = '%s_%s' % (field._tablename, field.name) # 'test_ph_eregistry_id' #select_widget.attributes.get('_id', None) add_args = [my_select_id] # create a div that will load the specified controller via ajax # form_loader_div = DIV(LOAD(c=self.controller, f=self.function, args=add_args, ajax=True), #
Re: [web2py] Two SQLFORMs side by side?
Let say the FK field is field2 : Field('field2','reference main_table', # Better syntax thand db.main_table widget=AutocompleteWidgetSelectOrAddOption( request=request, field=db.main_table.field1, # which is you reprensting field id_field=db.main_table.id, limitby=(0, 10), # how much records you want in the dropbox min_length=6, # when you want the autocomplete pop in or how many caracters user have to entered before the autocomplete kickin form_title=T('Add new title'), controller=controler name that contains the below function, function=your add function name, button_text=T('Add new'), placeholder=T('Start typing...')) Richard On Wed, May 6, 2015 at 12:34 PM, LoveWeb2py atayloru...@gmail.com wrote: Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title = current.T('Add New') else: self.form_title = current.T(form_title) if button_text is None: self.button_text = current.T('Add') else: self.button_text = current.T(button_text) self.dialog_width = dialog_width self.controller = controller self.function = function # -- def callback(self): if self.keyword in self.request.vars: field = self.fields[0]
Re: [web2py] Two SQLFORMs side by side?
Thank you, Richard. I think i'm getting closer. Could you show me an example of how you apply this to a specific field in SQLFORM? Going back to my original model: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('field1','db.main_table'), Field('field2','db.main_table') migrate=False) How could I integrate your widget with field 2 for a SQLFORM? On Wednesday, May 6, 2015 at 9:40:02 AM UTC-4, Richard wrote: The id field and what field you want to show as a representation of the id field of the referenced table... Start by putting the widget class in model file even if it not a good thing to see if you can make it works... In the module I have these imports : from gluon.html import * from gluon.sqlhtml import * from gluon import current from gluon.compileapp import LOAD Which may not be related to the widget class... Richard On Tue, May 5, 2015 at 4:28 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title = current.T('Add New') else: self.form_title = current.T(form_title) if button_text is None: self.button_text = current.T('Add') else: self.button_text = current.T(button_text) self.dialog_width = dialog_width self.controller = controller self.function = function # -- def callback(self): if self.keyword in self.request.vars: field = self.fields[0] rows = self.db(field.like(self.request.vars[self.keyword]+'%') ).select(orderby=self.orderby, limitby=self.limitby, *self.fields) if rows: if self.is_reference: id_field = self.fields[1] raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _value=s[id_field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _selected=(k == 0))
Re: [web2py] Two SQLFORMs side by side?
Hi Richard, I'm trying to get this setup, but am receiving an error self.url = URL(args=request.args)\nNameError: global name \'URL\' is not defined\n'. I'm wondering if this is because the gluon hasn't been imported yet. Also, could you ellaborate more on this? field=db.table.representing_field, id_field=db.table.id_field, id_field should be the foreignkey table if I am not mistaking? db.table.representing field, and db.table2.id_field (with foreign key) does that sound right? On Wednesday, April 29, 2015 at 10:04:35 AM UTC-4, Richard wrote: *# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title = current.T('Add New') else: self.form_title = current.T(form_title) if button_text is None: self.button_text = current.T('Add') else: self.button_text = current.T(button_text) self.dialog_width = dialog_width self.controller = controller self.function = function # -- def callback(self): if self.keyword in self.request.vars: field = self.fields[0] rows = self.db(field.like(self.request.vars[self.keyword]+'%') ).select(orderby=self.orderby, limitby=self.limitby, *self.fields) if rows: if self.is_reference: id_field = self.fields[1] raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _value=s[id_field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, '') def __call__(self, field, value, **attributes): # -- # From : SelectOrAddOption my_select_id = '%s_%s' % (field._tablename, field.name) # 'test_ph_eregistry_id' #select_widget.attributes.get('_id', None) add_args = [my_select_id] # create a div that will load the specified controller via ajax # form_loader_div = DIV(LOAD(c=self.controller, f=self.function, args=add_args, ajax=True), # _id=my_select_id + _dialog-form, _title=self.form_title) form_loader_div = DIV(DIV(BUTTON('x', _type='button', _class='close', **{'_data-dismiss': 'modal', '_aria-hidden': 'true'}), H3(self.form_title, _id='myModalLabel'), _class='modal-header'), DIV(LOAD(c=self.controller,
Re: [web2py] Two SQLFORMs side by side?
*# In a modules :* class AutocompleteWidgetSelectOrAddOption(object): _class = 'string' def __init__(self, request, field, id_field=None, db=None, orderby=None, limitby=(0, 10), keyword='_autocomplete_%(fieldname)s', min_length=2, # - # From : SelectOrAddOption controller=None, function=None, form_title=None, button_text = None, dialog_width=1000, # - placeholder=None ): self.request = request self.keyword = keyword % dict(fieldname=field.name) self.db = db or field._db self.orderby = orderby self.limitby = limitby self.min_length = min_length self.fields = [field] self.placeholder = placeholder if id_field: self.is_reference = True self.fields.append(id_field) else: self.is_reference = False if hasattr(request, 'application'): self.url = URL(args=request.args) self.callback() else: self.url = request # -- # From : SelectOrAddOption if form_title is None: self.form_title = current.T('Add New') else: self.form_title = current.T(form_title) if button_text is None: self.button_text = current.T('Add') else: self.button_text = current.T(button_text) self.dialog_width = dialog_width self.controller = controller self.function = function # -- def callback(self): if self.keyword in self.request.vars: field = self.fields[0] rows = self.db(field.like(self.request.vars[self.keyword]+'%') ).select(orderby=self.orderby, limitby=self.limitby, *self.fields) if rows: if self.is_reference: id_field = self.fields[1] raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _value=s[ id_field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, SELECT(_id=self.keyword, _class='autocomplete', _size=len(rows), _multiple=(len(rows) == 1), *[OPTION(s[field.name], _selected=(k == 0)) for k, s in enumerate(rows)]).xml()) else: raise HTTP(200, '') def __call__(self, field, value, **attributes): # -- # From : SelectOrAddOption my_select_id = '%s_%s' % (field._tablename, field.name) # 'test_ph_eregistry_id' #select_widget.attributes.get('_id', None) add_args = [my_select_id] # create a div that will load the specified controller via ajax # form_loader_div = DIV(LOAD(c=self.controller, f=self.function, args=add_args, ajax=True), # _id=my_select_id + _dialog-form, _title=self.form_title) form_loader_div = DIV(DIV(BUTTON('x', _type='button', _class='close', **{'_data-dismiss': 'modal', '_aria-hidden': 'true'}), H3(self.form_title, _id='myModalLabel'), _class='modal-header'), DIV(LOAD(c=self.controller, f=self.function, args=add_args, ajax=True, ajax_trap=True), _class='modal-body'), _id=my_select_id + _modal-form, _class='modal hide fade', **{'_tabindex': '-1', '_role': 'dialog', '_aria-labelledby': 'myModalLabel', '_aria-hidden': 'true'}) # generate the add button that will appear next the options widget and open our modal activator_button = A(I(_class='icon-plus-sign icon-2x'), _id=my_select_id+_option_add_trigger, _class='add-and-select-button') # create javascript for creating and opening the dialog # js = '$(#%s_dialog-form).dialog({' \ # 'autoOpen: false,' \
Re: [web2py] Two SQLFORMs side by side?
I'd love to see it, Richard! I'm banging my head against the wall with this other method. On Tuesday, April 28, 2015 at 6:58:25 PM UTC-4, Richard wrote: My own mix of SELECT_OR_ADD_OPTION() widget and web2py SQLFORM.widget.autocomplete... As wrote above I can share the code here... Richard On Tue, Apr 28, 2015 at 5:06 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: What do you use as a replacement? On Tuesday, April 28, 2015 at 4:59:32 PM UTC-4, Richard wrote: in view in script tag is a good place for start... just make sure you have the rigth id for you modal main div... In my case modal_id was coming from an .fromat(modal_id='id')... But I don't recall the exact way this tutorial was doing and I was just exposing to 2 generals reasons why form into modal won't submit correctly... In my case my widget was appending my modal with a LOAD component inside a form of the so the load form has to be put outside the main form... I try the ressource you are using and give up because it was not full fill all my requirement... Richard On Tue, Apr 28, 2015 at 4:54 PM, LoveWeb2py atayl...@gmail.com wrote: This is what I'm using in my layout: $(function() { $(td.w2p_fc).each(function (){ var comment = $(this).html(); if (comment){ $(this).html('divi class=icon info icon-info-sign/i/div'); $(this).children('div').attr('title',comment); $(this).children('div').tooltip({ placement : 'right', html : true, trigger : 'click' }); } }); }); This makes the comment field available as an Information Icon When I use the modal class referenced in the link it works great, the problem is nothing stores because the form can't process properly. I'm struggling to solve that last piece of the puzzle. When I On Tuesday, April 28, 2015 at 4:50:34 PM UTC-4, LoveWeb2py wrote: Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in
Re: [web2py] Two SQLFORMs side by side?
My own mix of SELECT_OR_ADD_OPTION() widget and web2py SQLFORM.widget.autocomplete... As wrote above I can share the code here... Richard On Tue, Apr 28, 2015 at 5:06 PM, LoveWeb2py atayloru...@gmail.com wrote: What do you use as a replacement? On Tuesday, April 28, 2015 at 4:59:32 PM UTC-4, Richard wrote: in view in script tag is a good place for start... just make sure you have the rigth id for you modal main div... In my case modal_id was coming from an .fromat(modal_id='id')... But I don't recall the exact way this tutorial was doing and I was just exposing to 2 generals reasons why form into modal won't submit correctly... In my case my widget was appending my modal with a LOAD component inside a form of the so the load form has to be put outside the main form... I try the ressource you are using and give up because it was not full fill all my requirement... Richard On Tue, Apr 28, 2015 at 4:54 PM, LoveWeb2py atayl...@gmail.com wrote: This is what I'm using in my layout: $(function() { $(td.w2p_fc).each(function (){ var comment = $(this).html(); if (comment){ $(this).html('divi class=icon info icon-info-sign/i/div'); $(this).children('div').attr('title',comment); $(this).children('div').tooltip({ placement : 'right', html : true, trigger : 'click' }); } }); }); This makes the comment field available as an Information Icon When I use the modal class referenced in the link it works great, the problem is nothing stores because the form can't process properly. I'm struggling to solve that last piece of the puzzle. When I On Tuesday, April 28, 2015 at 4:50:34 PM UTC-4, LoveWeb2py wrote: Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py
Re: [web2py] Two SQLFORMs side by side?
Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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+un...@googlegroups.com javascript:. 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.
Re: [web2py] Two SQLFORMs side by side?
There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayloru...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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+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. -- 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
Re: [web2py] Two SQLFORMs side by side?
Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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+un...@googlegroups.com. For more options, visit
Re: [web2py] Two SQLFORMs side by side?
What do you use as a replacement? On Tuesday, April 28, 2015 at 4:59:32 PM UTC-4, Richard wrote: in view in script tag is a good place for start... just make sure you have the rigth id for you modal main div... In my case modal_id was coming from an .fromat(modal_id='id')... But I don't recall the exact way this tutorial was doing and I was just exposing to 2 generals reasons why form into modal won't submit correctly... In my case my widget was appending my modal with a LOAD component inside a form of the so the load form has to be put outside the main form... I try the ressource you are using and give up because it was not full fill all my requirement... Richard On Tue, Apr 28, 2015 at 4:54 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: This is what I'm using in my layout: $(function() { $(td.w2p_fc).each(function (){ var comment = $(this).html(); if (comment){ $(this).html('divi class=icon info icon-info-sign/i/div'); $(this).children('div').attr('title',comment); $(this).children('div').tooltip({ placement : 'right', html : true, trigger : 'click' }); } }); }); This makes the comment field available as an Information Icon When I use the modal class referenced in the link it works great, the problem is nothing stores because the form can't process properly. I'm struggling to solve that last piece of the puzzle. When I On Tuesday, April 28, 2015 at 4:50:34 PM UTC-4, LoveWeb2py wrote: Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table
Re: [web2py] Two SQLFORMs side by side?
This is what I'm using in my layout: $(function() { $(td.w2p_fc).each(function (){ var comment = $(this).html(); if (comment){ $(this).html('divi class=icon info icon-info-sign/i/div'); $(this).children('div').attr('title',comment); $(this).children('div').tooltip({ placement : 'right', html : true, trigger : 'click' }); } }); }); This makes the comment field available as an Information Icon When I use the modal class referenced in the link it works great, the problem is nothing stores because the form can't process properly. I'm struggling to solve that last piece of the puzzle. When I On Tuesday, April 28, 2015 at 4:50:34 PM UTC-4, LoveWeb2py wrote: Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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
Re: [web2py] Two SQLFORMs side by side?
in view in script tag is a good place for start... just make sure you have the rigth id for you modal main div... In my case modal_id was coming from an .fromat(modal_id='id')... But I don't recall the exact way this tutorial was doing and I was just exposing to 2 generals reasons why form into modal won't submit correctly... In my case my widget was appending my modal with a LOAD component inside a form of the so the load form has to be put outside the main form... I try the ressource you are using and give up because it was not full fill all my requirement... Richard On Tue, Apr 28, 2015 at 4:54 PM, LoveWeb2py atayloru...@gmail.com wrote: This is what I'm using in my layout: $(function() { $(td.w2p_fc).each(function (){ var comment = $(this).html(); if (comment){ $(this).html('divi class=icon info icon-info-sign/i/div'); $(this).children('div').attr('title',comment); $(this).children('div').tooltip({ placement : 'right', html : true, trigger : 'click' }); } }); }); This makes the comment field available as an Information Icon When I use the modal class referenced in the link it works great, the problem is nothing stores because the form can't process properly. I'm struggling to solve that last piece of the puzzle. When I On Tuesday, April 28, 2015 at 4:50:34 PM UTC-4, LoveWeb2py wrote: Thank you, Richard. Where do I put $(#{modal_id}).appendTo( body); Could I just put that in the HTML file? Something like... script $(#{modal_id}).appendTo( body); /script I tried hardcoding the div_id of my modal into your code, but it didn't work. The database doesn't update properly with the correct foreign key. I also have some date value fields and the calendar.js doesn't pop down so I'm thinking this has something to do with http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Do you have an example of where you'd put the appendTo ? On Tuesday, April 28, 2015 at 1:04:57 PM UTC-4, Richard wrote: There is different issue when embed for into a bootstrap 2.3.2 (at least)... One that I found were that form tag get ripped off... The other depend of the way the modal form compoenent is included into the main form... Depending how the widget is write the extra are embed beside the original input field which don't work in case of a form tag since html form can't be nested... Modal don't offer any convenient support à this level and you have to manage this by yourself... But it is easy, you just need to use jquery .appendTo() : Like that : $(#{modal_id}).appendTo(body); And extract your component modal form which is nested into the main page form and append it to the body instead... This is basically what jQuery Dialog is doing out of the box which boostrap modal don't that make the usage of modal with component in web2py so difficult... :) Richard On Tue, Apr 28, 2015 at 12:40 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, This is working great. http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html I currently use it like this: def my_controller(): from modalplugins Import Modal field = db.mytable.field modal = Modal(field, ' Add', 'Add area','Area') db.mytable.field.comment = modal.create() grid=SQLFORM.smartgrid(db.my_other_table) formModal = modal.formModal() return(grid=grid, formModal=formModal) The problem I am having now is that I can't process the modal. Do you have any thoughts on how to do this? On Friday, April 17, 2015 at 9:50:15 AM UTC-4, Richard wrote: 'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayl...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table',
Re: [web2py] Two SQLFORMs side by side?
'reference tablename' = 1 to many 'list:reference tablename' = many to many it denormalised that why I put it between double quotes Richard On Thu, Apr 16, 2015 at 5:13 PM, LoveWeb2py atayloru...@gmail.com wrote: Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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. -- 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] Two SQLFORMs side by side?
Which lack autocomplete if I remember... On Thu, Apr 16, 2015 at 3:03 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: You have also this option : http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Richard On Thu, Apr 16, 2015 at 3:02 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayloru...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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. -- 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] Two SQLFORMs side by side?
Richard, I did want to have a foreign key for info_about_field1. I guess I could do a reference field1 ? On Thursday, April 16, 2015 at 3:02:51 PM UTC-4, Richard wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayl...@gmail.com javascript: wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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 javascript:. 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.
Re: [web2py] Two SQLFORMs side by side?
There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayloru...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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. -- 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] Two SQLFORMs side by side?
You have also this option : http://linuxapuntes.blogspot.com.ar/2013/03/plugin-modal-bootstrap-web2py.html Richard On Thu, Apr 16, 2015 at 3:02 PM, Richard Vézina ml.richard.vez...@gmail.com wrote: There is no relation between both tables... You can embed 2 forms as component (LOAD()) if you were having list:reference type field it is differents and you have to question yourself if you are not better to have something like SELECT_OR_ADD_OPTION() or even better AutocompleteSelectOrAddOption() widget... I recently update my old AutocompleteSelectOrAddOption() widget (not finish yet) in order to move from jquery ui dialog to bootstrap modal... I will publish a web2py slice when done. Just ask if it interest you I can publish preview here... Richard On Thu, Apr 16, 2015 at 2:08 PM, LoveWeb2py atayloru...@gmail.com wrote: Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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. -- 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] Two SQLFORMs side by side?
Hello, I'd like to have two SQLFORMs right next to each other. The second SQLFORM is just going to be linked to the field in table 1, but will be used so the student can make additional comments about a field. Model will look like this: db.define_table('main_table', Field('field1','string'), Field('field2','string'), migrate=False) db.define_table('second_table', Field('info_about_field1','list:string'), Field('info_about_field2','list:string') migrate=False) My question is... is it possible to have the second_table as a link underneath the main_table field. I want to have a modal pop up so they can enter additional information about the field -- 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.