Both are related to the python language, nothing Django specific about them.

This may help (not in explaining so much as demonstrating workarounds):

https://stackoverflow.com/questions/4162456/forward-declaration-of-classes
https://erdantic.drivendata.org/v0.4/forward-references/

Regards,
/d

------ Original Message ------
From "Michael Starr" <starrten...@gmail.com>
To "Django users" <django-users@googlegroups.com>
Date 3/4/2023 7:43:18 AM
Subject Ordering of code

Does anyone know why in django models (and I don't know how it is in etc. python), you can define a function below, and use it above in the code, but a class can't reference a class defined later in the code, or it won't find it?

That seems like beyond stupid to me.

Michael

--
You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2409c040-107d-40e3-a828-0013851d0d98n%40googlegroups.com <https://groups.google.com/d/msgid/django-users/2409c040-107d-40e3-a828-0013851d0d98n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/em52dd8be4-5db0-4ab4-96a5-097ef6e44e26%4090728edb.com.

Attachment: pgpbAnhgd2Lz0.pgp
Description: PGP signature

Reply via email to