Code

Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13348 closed (fixed)

After r12950, load_app does not return models modules from eggs

Reported by: kmtracey Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

#13334 points out a problem loading template tags from eggs. Since the change (to use imp.find_module) that introduced that problem was the inspiration for r12950, the r12950 code has the same problem, only for r12950 the problem involves loading models modules from apps in eggs. Ramiro pointed to a patch on #9427 that attempts to find modules loaded by eggs, but I could not quite get that code to work. I'll attach a patch that I did get to work, with tests. This patch introduces a utility function to answer the question: does this loaded module have a submodule named x? This seems to be something we could use in a few places.

Attachments (4)

egg_loading.diff (6.4 KB) - added by kmtracey 4 years ago.
modelapp.egg (3.3 KB) - added by kmtracey 4 years ago.
nomodelapp.egg (3.6 KB) - added by kmtracey 4 years ago.
omelet.egg (8.8 KB) - added by kmtracey 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by kmtracey

Changed 4 years ago by kmtracey

Changed 4 years ago by kmtracey

Changed 4 years ago by kmtracey

comment:1 Changed 4 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

The eggs are supposed to be in the diff but they're not. They're supposed to go under tests/regressiontests/app_loading/eggs.

comment:2 Changed 4 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by kmtracey

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

(In [12982]) Fixed #13348: Restored ability to load models from apps in eggs. Thanks Ramiro and metzen for pointers on how to find out if a module loaded from an egg has a particular submodule.

comment:4 Changed 4 years ago by kmtracey

(In [12983]) [1.1.X] Fixed #13348: Restored ability to load models from apps in eggs. Thanks Ramiro and metzen for pointers on how to find out if a module loaded from an egg has a particular submodule.

r12982 from trunk.

comment:5 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.