Global Variables - what am I missing here?

I am trying to implement global variables. Seems easy enough…

When I follow the doco as outlined here
https://anvil.works/docs/client/python/modules#global-variables

When I then try to implement the same techniques into my code, I get errors like
ImportError: No module named Globals

Looking at the styles of the icons in the left hand menu, I notice that they are different
to the demo sidebar app. https://sidebar-navigation.anvil.app/

So I’ve read elsewhere that this is probably due to the demo running an earlier anvil
version, to the standard default running now.

It seems that there is no labeling to indicate what versions are running when and where,
nor what version a demo is applicable to.

I realise platforms move forwards constantly, and doco gets out of date, but this apparent
lack of consistancy leads to a frustrating experience to someone learning anvil.

I have no doubt that someone will tell me how to do it, but that’s not the issue.
Why can’t I simply follow the documentation and the published examples?

This is the result of the recent update that changed how forms/modules are now hierarchical.

I’ll add this example to the forums log of ongoing documentation issues.

Anvil Documentation Issues [ON-GOING]

To import Globals in the new style forms - if in doubt trust the autocomplete
https://anvil.works/docs/structuring-your-app/how-to-import-things

1 Like

Thanks Stu!
That got me going again. Still does my head in as to what works where, but you’re right. The auto-complete seems to know what is required, in different places.
Regards Mark.

1 Like