浏览代码

Created Form1; Edited settings

florian.residori@gmail.com 3 年之前
父节点
当前提交
8f6fd1a925
共有 4 个文件被更改,包括 56 次插入5 次删除
  1. 5 4
      .anvil_editor.yaml
  2. 5 1
      anvil.yaml
  3. 18 0
      client_code/Form1/__init__.py
  4. 28 0
      client_code/Form1/form_template.yaml

+ 5 - 4
.anvil_editor.yaml

@@ -1,9 +1,10 @@
 unique_ids:
-  forms: {}
+  forms:
+    Form1: '1644127965059339743960149.557'
   modules: {}
   server_modules: {}
   assets:
-    theme.css: 7ZSDIIOITHVAXX7VLD5L3AV7M4QLWDAS
-    standard-page.html: ISUD2KOWJDEVMKNG645CQZA7LL3JPGM5
-    splash.html: IT47CKLN7JIJXASU4Q7NHSNVLE6SJ6K6
     header.jpg: 7KSQKX6BX46N4HZVHNQ7B3PFT6UHIMAV
+    splash.html: IT47CKLN7JIJXASU4Q7NHSNVLE6SJ6K6
+    standard-page.html: ISUD2KOWJDEVMKNG645CQZA7LL3JPGM5
+    theme.css: 7ZSDIIOITHVAXX7VLD5L3AV7M4QLWDAS

+ 5 - 1
anvil.yaml

@@ -1,5 +1,9 @@
 allow_embedding: false
 package_name: Hello_San_Francisco_1
 name: Hello San Francisco 1
+startup_form: Form1
 runtime_options: {version: 2, client_version: '3', server_version: python3-sandbox}
-services: []
+services:
+- source: /runtime/services/tables.yml
+  client_config: {}
+  server_config: {}

+ 18 - 0
client_code/Form1/__init__.py

@@ -0,0 +1,18 @@
+from ._anvil_designer import Form1Template
+from anvil import *
+import anvil.tables as tables
+import anvil.tables.query as q
+from anvil.tables import app_tables
+import yaml
+
+class Form1(Form1Template):
+  def __init__(self, **properties):
+    # Set Form properties and Data Bindings.
+    self.init_components(**properties)
+
+    # Any code you write here will run when the form opens.
+
+  def check_click(self, **event_args):
+    """This method is called when the button is clicked"""
+    print(yaml.safe_load(self.yaml_input.text))
+

+ 28 - 0
client_code/Form1/form_template.yaml

@@ -0,0 +1,28 @@
+is_package: true
+container:
+  type: HtmlTemplate
+  properties: {tooltip: '', background: '', foreground: '', border: '', visible: true,
+    role: null, html: '@theme:standard-page.html'}
+components:
+- type: ColumnPanel
+  properties: {col_widths: '{}'}
+  name: content_panel
+  layout_properties: {slot: default}
+  components:
+  - type: TextArea
+    properties: {}
+    name: yaml_input
+    layout_properties: {slot: default, grid_position: 'QBAEHF,LHVVNF'}
+  - type: Button
+    properties: {role: null, align: center, tooltip: '', border: '', enabled: true,
+      foreground: '', visible: true, text: 'Check
+
+        ', font_size: null, font: '', spacing_above: small, icon_align: left, spacing_below: small,
+      italic: false, background: '', bold: false, underline: false, icon: ''}
+    name: check
+    layout_properties: {slot: default, grid_position: 'VTVZAV,KZXXGI'}
+    event_bindings: {click: check_click}
+  - type: TextArea
+    properties: {}
+    name: output
+    layout_properties: {grid_position: 'VSVEIR,ESSUYK', slot: default}