Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1790 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Avoid need for max_repetitions

Reported by: paj Owned by: paj
Priority: normal Milestone: 1.5
Component: ToscaWidgets Version: 1.0.4.4
Severity: normal Keywords:
Cc:

Description

Currently WidgetRepeater? creates a RepeatedWidget? instance for each possible repetition. This costs memory and startup time, and it means the maximum number of repetitions needs to be defined in advance. In some of my applications it is a real pain to define max_repetitions in advance, I need to make it massive to handle potential large data sets, and this makes startup slow.

So, I propose a refactoring, to avoid creating a RepeatedWidget? for each repetition. Instead, a single RepeatedWidget? will be created, and it will get its repetition number from request local storage. This is more similar to how TG widgets work. The plan of changes is:

In WidgetRepeater?: repetition becomes a RequestLocalDescriptor? new just creates a single RepeatedWidget? update_params will set repetition on the RepeatedWidget?, as it goes through the loop Update

Ok, enough spiel, I will have a go at implementing this now. Looks like some changes to twForms will be needed to.

Attachments

tw-no-maxrep.patch Download (3.3 KB) - added by paj 11 years ago.
twf-no-maxrep.patch Download (955 bytes) - added by paj 11 years ago.
twf-nomaxrep2.patch Download (1.4 KB) - added by paj 11 years ago.
tw-nomaxrep2.patch Download (4.1 KB) - added by paj 11 years ago.

Change History

Changed 11 years ago by paj

Changed 11 years ago by paj

Changed 11 years ago by paj

Changed 11 years ago by paj

comment:1 Changed 11 years ago by paj

  • Status changed from new to closed
  • Resolution set to fixed

Ok, committed!

Note: See TracTickets for help on using tickets.