Changes between Version 4 and Version 5 of Ticket #20267, comment 2


Ignore:
Timestamp:
Apr 16, 2013, 2:28:48 PM (11 years ago)
Author:
clime

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20267, comment 2

    v4 v5  
    4141which I don't like at all but it was the simplest solution.
    4242
    43 But I have worked on and discovered yet another problem with order_by and order_asc fields. These fields are not part of the frontend form (by graphic design and provided templates) but it seemed natural to put them into the backend/logic form anyway so that I can simply pass these parameters to model with others and then in models differentiate what to put as param of .filter() and what to put as a param of .order_by(). This approach simply makes view simpler (which is good, I think). Backend form does not "match" the frontend/rendered form but it was (and should be) possible to do it like this without any javascript hacks and it all worked well. Except initial values because checking if request.GET is empty before passing it to the filter was no longer working. Basically, if querystring has not been populated, submitting the form trashed initial values for ordering and submitting the ordering trashed initial values for filtering. In the end I needed to do something like this in view:
     43But I have worked on and discovered yet another problem with order_by and order_asc fields. These fields are not part of the frontend form (by graphic design and provided templates) but it seemed natural to put them into the backend/logic form anyway so that I can simply pass these parameters to model with others and then in models differentiate what to put as param of .filter() and what to put as a param of .order_by(). This approach simply makes view simpler (which is good, I think). Backend form does not "match" the frontend/rendered form but it was (and should be) possible to do it like this without any javascript hacks and it worked well. Except from initial values because checking if request.GET is empty before passing it to the filter was no longer working. Basically, if querystring has not been populated, submitting the form trashed initial values for ordering and submitting the ordering trashed initial values for filtering. In the end I needed to do something like this in view:
    4444
    4545{{{
Back to Top