On Tue, 2009-01-06 at 04:42 -0800, Polat Tuzla wrote:
> Hi,
> Suppose I have two classes in "models.py", namely A and B. And there
> is the manager for B as BManager in "managers.py". BManager makes use
> of clas A.
>
> This situation leads to circular imports between "managers.py" and
> "models.
On 6 jan, 19:45, Ben Eliott wrote:
> Not that pretty/efficient but you could use contenttype contrib
> temporarily.
> IF ClassB has a ForeignKey to Class A could you extract the Class A
> model from a foreign key via Class B's .meta?
> Or the Class B could have a callable method which returned
Not that pretty/efficient but you could use contenttype contrib
temporarily.
IF ClassB has a ForeignKey to Class A could you extract the Class A
model from a foreign key via Class B's .meta?
Or the Class B could have a callable method which returned the
instance of the model you want...
No
on 6 jan, 14:54, Polat Tuzla wrote:
(snip)
> The reason why I need to separate models and managers into different
> files is that they have simply grown to thousands of lines.
>
It's indeed a very compelling reason !-)
But (simple suggestion - I know nothing about your project...) don't
you see
Yes, indeed! It's the models.Manager I'm talking about.
I tried to keep my example short and easily comprehensible without
code snippets, but i think I've achieved the opposite.
Sorry for any inconvenience.
Polat Tuzla
On Jan 6, 3:37 pm, bruno desthuilliers
wrote:
> On 6 jan, 14:08, Lee Braiden
Thank you very much for both of your responses. Local imports solved
my problem.
I had previously tried this without success, apparently there was
another mistake in the code.
Upon Bruno's suggestion I gave it another try, and it worked!
The reason why I need to separate models and managers into
On 6 jan, 14:08, Lee Braiden wrote:
> On Tue, 2009-01-06 at 04:42 -0800, Polat Tuzla wrote:
> > Hi,
> > Suppose I have two classes in "models.py", namely A and B. And there
> > is the manager for B as BManager in "managers.py". BManager makes use
> > of clas A.
>
> > This situation leads to circu
On 6 jan, 13:42, Polat Tuzla wrote:
> Hi,
> Suppose I have two classes in "models.py", namely A and B. And there
> is the manager for B as BManager in "managers.py". BManager makes use
> of clas A.
>
> This situation leads to circular imports between "managers.py" and
> "models.py" for which I ca
On Tue, 2009-01-06 at 04:42 -0800, Polat Tuzla wrote:
> Hi,
> Suppose I have two classes in "models.py", namely A and B. And there
> is the manager for B as BManager in "managers.py". BManager makes use
> of clas A.
>
> This situation leads to circular imports between "managers.py" and
> "models.
Hi,
Suppose I have two classes in "models.py", namely A and B. And there
is the manager for B as BManager in "managers.py". BManager makes use
of clas A.
This situation leads to circular imports between "managers.py" and
"models.py" for which I can't find a solution.
Assuming that I need to sepa
10 matches
Mail list logo