Re: How best to delete one of multiple records?
On Tue, Jun 24, 2008 at 4:42 AM, Spy187 <[EMAIL PROTECTED]> wrote: > > AND BTW using GET for side effects can be extremely convenient when > used for debugging purposes as you can directly modify the URL. What's convenient during development isn't necessarily a good idea in a production setting. (For example, using Django's development webserver or having DEBUG = True in your settings module.) Arien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
This is the best way to do it, the tickboxes and then a single submit button. Then layer AJAX on top of it and hide the tickboxes, replacing them with nice icons which when clicked sends a POST request to the server to delete the recond. Upon success it deletes the record from the HTML. There is no better way than that. AND BTW using GET for side effects can be extremely convenient when used for debugging purposes as you can directly modify the URL. David On Jun 24, 12:26 am, Arien <[EMAIL PROTECTED]> wrote: > On Mon, Jun 23, 2008 at 1:51 PM, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > > On 6/23/08, Emil Styrke <[EMAIL PROTECTED]> wrote: > > >> Having a GET request delete records is usually a bad idea - see for example > >>http://www.w3.org/2001/tag/doc/whenToUseGet.html > > > Yes, this is a recommendation, not a dogma. IMHO GET method is > > suitable for dense tables with dozens of operations. > > Whether it's a good idea to use GET or not doesn't depend on > presentation issues. > > Arien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
On Mon, Jun 23, 2008 at 1:51 PM, Peter Melvyn <[EMAIL PROTECTED]> wrote: > > On 6/23/08, Emil Styrke <[EMAIL PROTECTED]> wrote: > >> Having a GET request delete records is usually a bad idea - see for example >> http://www.w3.org/2001/tag/doc/whenToUseGet.html > > Yes, this is a recommendation, not a dogma. IMHO GET method is > suitable for dense tables with dozens of operations. Whether it's a good idea to use GET or not doesn't depend on presentation issues. Arien --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
On 6/23/08, Emil Styrke <[EMAIL PROTECTED]> wrote: > Having a GET request delete records is usually a bad idea - see for example > http://www.w3.org/2001/tag/doc/whenToUseGet.html Yes, this is a recommendation, not a dogma. IMHO GET method is suitable for dense tables with dozens of operations. Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
2008/6/23 Peter Melvyn <[EMAIL PROTECTED]>: > > > I have a list of records, and I'd like the user to be able to delete > > any given record by pressing a button. > > IMHO there are two basic solutions: > > 1. each record has column with hyperlink to delete action (ID is part of > URL) > You can use plain text or image mapped links Having a GET request delete records is usually a bad idea - see for example http://www.w3.org/2001/tag/doc/whenToUseGet.html If the request has side effects, a POST should be used, for example the original form idea. Another idea is to have a single form with only a hidden ID input - then a link for each item could use javascript to set the correct ID and submit the form. I'm sure there are other javascript contraptions that could accomplish the same, but any such approach would of course require javascript in the client. /Emil --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
> I have a list of records, and I'd like the user to be able to delete > any given record by pressing a button. IMHO there are two basic solutions: 1. each record has column with hyperlink to delete action (ID is part of URL) You can use plain text or image mapped links 2. each record has checkbox and there is a single DELETE button Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: How best to delete one of multiple records?
Kenneth McDonald wrote: > I have a list of records, and I'd like the user to be able to delete > any given record by pressing a button. My current strategy is to have > each record in its own form (so that pressing the submit button for > that form would delete the record), and have each form contain a > hidden field identifying the corresponding record via a unique key so > that I know which record to delete. However, this is very crude, and > no doubt indicative of the fact that I'm still just starting to learn > Django. What would people suggest as better alternatives? Feel free to > point me to documentation--I don't mind doing the reading, it's just > finding the relevant material that's a problem (there's so much of > it :-) ). I don't think that's bad, all depends on how you want UI to work. Other options would be putting them in a ChoiceField and using Select (dropdown) RadioSelect (radio buttons) or some custom widget. The choice field options will have only one delete button but require user to select which record to delete. That may or may not be a better ui than multiple delete buttons. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman ___ You've got fun! Check out Austin360.com for all the entertainment info you need to live it up in the big city! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
How best to delete one of multiple records?
I have a list of records, and I'd like the user to be able to delete any given record by pressing a button. My current strategy is to have each record in its own form (so that pressing the submit button for that form would delete the record), and have each form contain a hidden field identifying the corresponding record via a unique key so that I know which record to delete. However, this is very crude, and no doubt indicative of the fact that I'm still just starting to learn Django. What would people suggest as better alternatives? Feel free to point me to documentation--I don't mind doing the reading, it's just finding the relevant material that's a problem (there's so much of it :-) ). Thanks, Ken --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---