Opened 14 years ago
Last modified 12 years ago
#13917 new New feature
Multiple popup window feature of related objects popup through id_to_windowname
Reported by: | davidcooper | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | yes |
Description
In an app that has a cascading set of objects we required the ability to have multiple popup windows. In tabbed browsers this can work out well, especially when the tabs can cascade like the firefox tree-style view. To bring this support to django all that is required is an override for the two methods id_to_windowname and windowname_to_id at line 18 of django/contrib/admin/media/js/admin/RelatedObjectLookups.js, such as this:
var uniqueness=(new Date()).valueOf(); function id_to_windowname(text) { text = text.replace(/\./g, '__dot__'); text = text.replace(/\-/g, '__dash__'); return uniqueness + text; } function windowname_to_id(text) { text = text.replace(uniqueness, ''); text = text.replace(/__dot__/g, '.'); text = text.replace(/__dash__/g, '-'); return text; }
This trivial change to the 'name' of the window allows multiple caller-callee connections, even involving the same models, as used as the id.
Dave
Change History (8)
comment:1 by , 14 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Unreviewed → Design decision needed |
comment:2 by , 14 years ago
Sorry for ignoring this. I can say that I have used it on my site for sometime now without problem. I cannot imagine how any existing service would be impacted negatively, the change is pretty trivial and is isolated.
comment:3 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:4 by , 13 years ago
UI/UX: | set |
---|
comment:8 by , 12 years ago
Triage Stage: | Design decision needed → Accepted |
---|
This sounds interesting. Marking as DDN as it's unclear what the implications would be. Could you provide a more specific use case for this? Any proof that your suggested change wouldn't break any existing code would also be appreciated.