Are Model Classes available in Uplink code?

What I’m trying to do:
Get some information that I can use for making design decisions.

Currently, I use “raw” data table rows in one of my Uplink programs, for communication back to the main App and its users. This will continue to work, of course.

But Best Practices says “Describe all operations in your model class”, and in this case, some of those operations occur in my Uplink programs.

1 Like

I have the same question. I’m trying to figure out how to import model classes into my server uplink code so that I can access functions and properties of those classes there.

I haven’t tested this myself, so it’s just an assumption based on how things usually work, but I’d expect it to function correctly.

You just need to clone the app to your computer, then configure your uplink script to import modules from that cloned app. Just make that your anvil-uplink package is up to date with the latest version.

Given when Anvil Uplink was last updated, vs. when the feature was added Server-side, I’d expect otherwise.

Edit:
Anvil Uplink v0.5.2 published 2024-10-30
Model Classes announced 2025-02-17

So I do not expect to be able to define Model Classes in my Uplink programs until a future version of Anvil Uplink.

1 Like