Ordering of code

21 views
Skip to first unread message

Michael Starr

unread,
Mar 3, 2023, 5:01:04 PM3/3/23
to Django users
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

David Nugent

unread,
Mar 3, 2023, 7:14:46 PM3/3/23
to django...@googlegroups.com, Michael Starr
Both are related to the python language, nothing Django specific about them.

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


Regards,
/d

------ Original Message ------
From "Michael Starr" <starr...@gmail.com>
To "Django users" <django...@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...@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.

Michael Starr

unread,
Mar 3, 2023, 10:32:56 PM3/3/23
to Django users
Thank you, David.
Michael
Reply all
Reply to author
Forward
0 new messages