Comments (3)
OK, I looked into this some more. When one adds or changes an instance, Django's admin does indeed call back to the parent window of the id and name of the Location that has been added or changed. There might be a way to just fire off an Ajax call when this callback happens (by creating an event handler for whenever the select options for the location are modified).
However, I think that it may make sense to just override the default callback process entirely. Here's how that would work:
- In
danceschool.core.admin
, in the LocationAdmin class Override the ModelAdmin methodsresponse_add()
andresponse_change()
to pass along not just the name and id of the added/modified location, but also the capacity information and room listing for that location. Also, change the methods to return a modified version of templates/admin/response_popup.html - The response template
templates/admin/response_popup.html
just returns a simple HTML document with included Javascript from static/admin/js/popup_response.js. Change this document to call a modified version of this file. - The current version of
static/admin/js/popup_response.js
just calls the functionsdismissAddRelatedObjectPopup()
anddismissChangeRelatedObjectPopup()
from static/admin/js/admin/RelatedObjectLookups.js. Instead, call a modified version of these functions that not only adds/modifies the ID and name of the added/changed Location instance, but that also loads in the passed defaultCapacity and room data if it is provided.
I don't have time to take this on immediately, but we should definitely go ahead and get this bug fixed before the rooms branch is merged into master.
from django-danceschool.
Actually, I was able to get this modified and operational. The associated update has been pushed to the rooms branch.
from django-danceschool.
I think this has been adequately tested on the rooms branch, so I'm closing it.
from django-danceschool.
Related Issues (20)
- Unable to run manage.py on a project using version 8.4 HOT 5
- Huey version 2.0 changed its SQLite API HOT 4
- Location-specific dance roles limit HOT 2
- Expense Item save fails when user does not have permission to Mark Expenses Paid at Time Of Submission HOT 3
- data JSONFields for Event, RevenueItem, and ExpenseItem models HOT 1
- Remove "oneTimeSeries" flag from ClassDescription and implement ClassDescription autocomplete HOT 5
- Remove djangocms-forms dependencies and potentially replace with aldryn-forms HOT 1
- Display class types by location HOT 2
- [Bug] Migration failing for OneToOneField(StaffMember) HOT 4
- Initial migrate is failing HOT 2
- Unable to create the database tables from scratch HOT 1
- Registration Success Emails do not contain information about class registrations HOT 9
- StaffDirectoryView causing no instructors to show on Instructor Page HOT 8
- CSS off for class registration with one role HOT 3
- Time is 2 hours off, despite setting timezone HOT 3
- Not Found: / HOT 13
- TypeError: '<' not supported between instances of 'NoneType' and 'NoneType' HOT 1
- If drop-ins are allowed then drop-in price must be specified by the Pricing Tier.
- Class balance and waiting lists? HOT 1
- AttributeError: 'NoneType' object has no attribute 'startTime'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-danceschool.