• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Showcasing three recent improvements to Anvil

Sascha Оффлайн

Sascha

Заместитель Администратора
Команда форума
Администратор
Регистрация
9 Май 2015
Сообщения
1,605
Баллы
155
We've made changes to improve your developer experience


Anvil is always evolving to give its users full power to make any web app they wish. In this article, we'll go over three recent features that we made specifically to give more control and options when building web apps with Anvil.

Here's what our latest efforts empower you to do, with nothing but Python:

  • Use industry-standard design language, with the Material 3 theme.
  • Use smart and secure databases, with Model Classes.
  • Build easily navigable multi-page apps, with Anvil's routing dependency.

If you want to see all these features in action, take a look at

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

.

Apply industry-standard design language


How your app looks is, understandably, a huge priority when it comes to building an Anvil app. So, we've given you more tools to get your app to look exactly how you want it to.

First off, our new Material 3 Theme is here with plenty of shiny and sleek components for you to use.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



The Anvil Material 3 Theme is available for both

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

. It is

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

and updated regularly.

Secondly, we've changed our approach to themes and enhanced the ability for you to create your own themes and components.

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

. You can make an entire app filled with components styled exactly how you see fit, and then use this app as a dependency. This lets you build a library of components, themes and layouts that you can then use in any other app. In fact, that's exactly how we built the Material 3 Theme!

Ensure secure and powerful database interactions


Dealing with data can be difficult -- you need your data to be flexible, modifiable and accessible, yet secure. This is where Model Classes come in. Model Classes let you handle all validation, observation and transformation in one single Python script, letting you enjoy all the benefits of a secure database without compromising on flexibility.

Here are a few things Model Classes enable you to do:

  • Have your user rows automatically calculate the age of the user they represent, using their registered date of birth.
  • Ensure the execution of specific code whenever a new row is created or updated.
  • Check for permission when a user attempts to modify a row.

For example, let's say that we have an app where users can create accounts, and we want to notify the app owner whenever a new user is created.


from anvil.tables import app_tables
import anvil.email

class User(app_tables.users.row):
# We inherit from the Row class from our users table.
# Through Model Classes, this allows us to add logic to our row objects.

def _do_create():
# This method is run every time a new row object is created.
anvil.email.send(
to="owner@email.com",
subject="New User Registered",
text = """Hello Owner!
A new user has registered to your app.
"""
)




With just this simple script, we have added logic to our data table, and now, you can too!

All this and much more is dutifully explained in

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

.

Provide clear navigation


We've built a new way to use routing for page navigation within Anvil. Our new

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

makes the set-up process very easy, letting you set up and configure URL routes via a script, as you would any other element of your app.

Routing empowers you to:

  • Let your users use browser bookmarks
  • Redirect your users
  • Enable navigation to specific app states from an external link


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Using routing for navigation offers a very native experience for your users, and the routing dependency lets you implement it the same way you would any other component. Our

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

is a great starting-off point, and the

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

has all the technical details you could possibly ask for.

Dive in!


We hope that these additional tools empower our users to build exactly what they have in mind, with all the features they desire. All you need to get started is

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

, and get coding. It's that easy.

If you're looking for an example,

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

showcases all the features described here, with explanatory comments throughout the code.

We also have a bunch of

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

to help if you're ever lost, and the

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

is filled to the brim with brilliant and helpful people, so you're never alone.



Источник:

Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу