本簡報是 Will 保哥在 2016/6/24 於 CTJS 中台灣 JavaScript Conference 的演講簡報
[ 相關連結 ]
本次演講的 Live Demo 原始碼
https://github.com/doggy8088/ctjs2016-ng2demo
The Will Will Web記載著 Will 在網路世界的學習心得與技術分享
http://blog.miniasp.com/
Will 保哥的技術交流中心 (臉書粉絲專頁)
http://www.facebook.com/will.fans
Will 保哥的噗浪
http://www.plurk.com/willh/invite
Will 保哥的推特
https://twitter.com/Will_Huang
Vue.js is a progressive framework for building user interfaces. It was created by Evan You and first released in October 2015. Some key points:
- Vue uses a declarative paradigm and reactive system to efficiently update the DOM when data changes.
- The core of a Vue app is a Vue instance, which manages data and renders templates to the page. Components are reusable Vue instances that can be composed into trees.
- Templates are rendered with Mustache syntax and directives like v-if, v-for, v-on handle conditional rendering and events.
- Data flows from parent to child components through props, and from child to parent through events. The v-model
Van Wilson
Senior Consultant with Cardinal Solutions
Find more by Van Wilson: https://speakerdeck.com/vjwilson
All Things Open
October 26-27, 2016
Raleigh, North Carolina
This document provides an introduction to Java programming through a series of Java 101 tutorials. It discusses setting up a Java development environment, provides an overview of the Java language, and demonstrates how to write a first Java program. It also covers built-in Java data types like String, int, double, and boolean, and control structures like conditionals and loops. The document concludes with exercises for readers to practice working with command line arguments, operators, arrays, and random number generation in Java.
The document discusses function-based views (FBVs) and class-based views (CBVs) in Django. It recommends using CBVs for new projects and FBVs for existing projects that only need to subclass some views. The document also provides best practices for FBVs, such as keeping business logic out of views and using decorators. It emphasizes loose coupling between URLs and views for better maintainability.
The document discusses the Django admin interface and alternatives. It describes when to use the Django admin, such as for initial data entry but not public end users. It also discusses customizing the admin display and functions. Finally, it reviews some alternative admin apps for Django like django-xadmin and django-grappelli as well as admin plugins for other frameworks like Flask.
This document provides an introduction to the book "Two Scoops of Django" by Michelle Leu. It discusses the authors' backgrounds working on Python and Django projects. It provides recommendations for coding style when working with Django, including following PEP8 standards, using explicit relative imports, and avoiding wildcard imports. It also recommends using underscores instead of dashes in URLs and template block names for compatibility. The document concludes by thanking the reader and providing contact details for the author.
Van Wilson
Senior Consultant with Cardinal Solutions
Find more by Van Wilson: https://speakerdeck.com/vjwilson
All Things Open
October 26-27, 2016
Raleigh, North Carolina
This document provides an introduction to Java programming through a series of Java 101 tutorials. It discusses setting up a Java development environment, provides an overview of the Java language, and demonstrates how to write a first Java program. It also covers built-in Java data types like String, int, double, and boolean, and control structures like conditionals and loops. The document concludes with exercises for readers to practice working with command line arguments, operators, arrays, and random number generation in Java.
The document discusses function-based views (FBVs) and class-based views (CBVs) in Django. It recommends using CBVs for new projects and FBVs for existing projects that only need to subclass some views. The document also provides best practices for FBVs, such as keeping business logic out of views and using decorators. It emphasizes loose coupling between URLs and views for better maintainability.
The document discusses the Django admin interface and alternatives. It describes when to use the Django admin, such as for initial data entry but not public end users. It also discusses customizing the admin display and functions. Finally, it reviews some alternative admin apps for Django like django-xadmin and django-grappelli as well as admin plugins for other frameworks like Flask.
This document provides an introduction to the book "Two Scoops of Django" by Michelle Leu. It discusses the authors' backgrounds working on Python and Django projects. It provides recommendations for coding style when working with Django, including following PEP8 standards, using explicit relative imports, and avoiding wildcard imports. It also recommends using underscores instead of dashes in URLs and template block names for compatibility. The document concludes by thanking the reader and providing contact details for the author.
25. MODEL FIELD
➤ Field options
➤ null=True v.s. blank=True
➤ CharField & TextField only need to use blank=True
➤ default
➤ choices
➤ ex: status
➤ help_text
➤ unique
➤ db_index
➤ db_column
26. MODELS
➤ Relationship fields
➤ ForeignKey
➤ Many-to-one relationships
➤ ManyToManyField
➤ OneToOneField
Book
Category Tag
1
m m
n
27. MIGRATIONS
➤ makemigrations & migrate
➤ sqlmigrate, which displays the SQL statements for a
migration.
➤ ex: python manage.py sqlmigrate books 0001
➤ showmigrations, which lists a project’s migrations and their
status.
➤ New in 1.10
➤ python manage.py migrate —list (before 1.10)
28. ADMIN
➤ createsuperuser
➤ Password - It must contain at least 8 characters. (1.10)
➤ admin.py
➤ @admin.register(Book)
➤ admin.site.register(Book)
➤ __str__ method
30. ADMIN 中⽂文化 - PART I
➤ settings.py
➤ LANGUAGE_CODE = 'zh-hant'
32. MODEL META
➤ Model Meta options
➤ db_table
➤ default: books_book
➤ ordering
➤ ex: ordering = [‘-published']
➤ unique_together
➤ ex: unique_together = (("name", "author"),)
➤ ManyToManyField cannot be included in
unique_together
33. ADMIN 中⽂文化 - PART II
➤ Model Meta options
➤ verbose_name & verbose_name_plural
35. ADMIN 中⽂文化 - PART III
➤ books/apps.py
➤ books/__init__.py
37. ADMIN 中⽂文化 - PART IV
➤ Model Field options
➤ verbose_name