Django Book Documentation Выпуск 0.1

Total Page:16

File Type:pdf, Size:1020Kb

Django Book Documentation Выпуск 0.1 Django Book Documentation Выпуск 0.1 Matt Behrens 11 April 2015 Оглавление 1 Introduction 3 2 Chapter 1: Introduction to Django5 2.1 What Is A Web Framework?....................................5 2.2 The MVC Design Pattern......................................6 2.3 Django’s History...........................................8 2.4 How To Read This Book......................................9 3 Chapter 2: Getting Started 11 3.1 Installing Python.......................................... 11 3.2 Installing Django........................................... 12 3.3 Testing the Django installation................................... 14 3.4 Setting Up a Database....................................... 15 3.5 Starting a Project.......................................... 16 3.6 What’s Next?............................................ 18 4 Chapter 3: Views and URLconfs 19 4.1 Your First Django-Powered Page: Hello World.......................... 19 4.2 How Django Processes a Request.................................. 25 4.3 Your Second View: Dynamic Content............................... 25 4.4 URLconfs and Loose Coupling................................... 27 4.5 Your Third View: Dynamic URLs................................. 28 4.6 Django’s Pretty Error Pages.................................... 31 4.7 What’s next?............................................. 32 5 Chapter 4: Templates 33 5.1 Template System Basics....................................... 33 5.2 Using the Template System..................................... 35 5.3 Basic Template Tags and Filters.................................. 42 5.4 Philosophies and Limitations.................................... 47 5.5 Using Templates in Views...................................... 48 5.6 Template Loading.......................................... 49 5.7 Template Inheritance........................................ 54 5.8 What’s next?............................................. 58 6 Chapter 5: Models 59 6.1 The “Dumb” Way to Do Database Queries in Views....................... 59 6.2 The MTV (or MVC) Development Pattern............................ 60 6.3 Configuring the Database...................................... 61 i 6.4 Your First App............................................ 63 6.5 Defining Models in Python..................................... 64 6.6 Your First Model.......................................... 65 6.7 Installing the Model......................................... 66 6.8 Basic Data Access.......................................... 69 6.9 Adding Model String Representations............................... 70 6.10 Inserting and Updating Data.................................... 71 6.11 Selecting Objects.......................................... 72 6.12 Deleting Objects........................................... 77 6.13 What’s Next?............................................ 78 7 Chapter 6: The Django Admin Site 79 7.1 The django.contrib packages.................................... 79 7.2 Activating the Admin Interface................................... 79 7.3 Using the Admin Site........................................ 80 7.4 Adding Your Models to the Admin Site.............................. 86 7.5 How the Admin Site Works..................................... 87 7.6 Making Fields Optional....................................... 88 7.7 Customizing Field Labels...................................... 89 7.8 Custom ModelAdmin classes.................................... 90 7.9 Users, Groups, and Permissions.................................. 100 7.10 When and Why to Use the Admin Interface – And When Not to................ 102 7.11 What’s Next?............................................ 103 8 Chapter 7: Forms 105 8.1 Getting Data From the Request Object.............................. 105 8.2 A Simple Form-Handling Example................................. 107 8.3 Improving Our Simple Form-Handling Example......................... 110 8.4 Simple validation.......................................... 111 8.5 Making a Contact Form....................................... 113 8.6 Your First Form Class........................................ 116 8.7 Tying Form Objects Into Views.................................. 118 8.8 Changing How Fields Are Rendered................................ 119 8.9 Setting a Maximum Length..................................... 120 8.10 Setting Initial Values........................................ 120 8.11 Custom Validation Rules...................................... 121 8.12 Specifying labels........................................... 121 8.13 Customizing Form Design...................................... 122 8.14 What’s Next?............................................ 123 9 Chapter 8: Advanced Views and URLconfs 125 9.1 URLconf Tricks........................................... 125 9.2 Including Other URLconfs..................................... 140 9.3 What’s Next?............................................ 142 10 Chapter 9: Advanced Templates 143 10.1 Template Language Review..................................... 143 10.2 RequestContext and Context Processors.............................. 144 10.3 Automatic HTML Escaping..................................... 148 10.4 Inside Template Loading...................................... 150 10.5 Extending the Template System.................................. 151 10.6 Writing Custom Template Loaders................................. 160 10.7 Configuring the Template System in Standalone Mode...................... 161 10.8 What’s Next............................................. 162 ii 11 Chapter 10: Advanced Models 163 11.1 Related Objects........................................... 163 11.2 Making Changes to a Database Schema.............................. 165 11.3 Managers............................................... 167 11.4 Model methods............................................ 170 11.5 Executing Raw SQL Queries.................................... 171 11.6 What’s Next?............................................ 172 12 Chapter 11: Generic Views 173 12.1 Using Generic Views......................................... 173 12.2 Generic Views of Objects...................................... 174 12.3 Extending Generic Views...................................... 176 12.4 What’s Next?............................................ 180 13 Chapter 12: Deploying Django 181 13.1 Preparing Your Codebase for Production............................. 181 13.2 Using Different Settings for Production.............................. 183 13.3 DJANGO_SETTINGS_MODULE................................ 185 13.4 Using Django with FastCGI.................................... 185 13.5 Scaling................................................ 190 13.6 Performance Tuning......................................... 195 13.7 What’s Next?............................................ 196 14 Chapter 13: Generating Non-HTML Content 197 14.1 The basics: views and MIME-types................................ 197 14.2 Producing CSV........................................... 198 14.3 Generating PDFs.......................................... 199 14.4 Other Possibilities.......................................... 201 14.5 The Syndication Feed Framework................................. 202 14.6 The Sitemap Framework...................................... 207 14.7 What’s Next?............................................ 211 15 Chapter 14: Sessions, Users, and Registration 213 15.1 Cookies................................................ 213 15.2 Django’s Session Framework.................................... 215 15.3 Users and Authentication...................................... 220 15.4 Permissions, Groups and Messages................................. 228 15.5 What’s Next............................................. 230 16 Chapter 15: Caching 231 16.1 Setting Up the Cache........................................ 231 16.2 The Per-Site Cache......................................... 235 16.3 The Per-View Cache......................................... 235 16.4 Template Fragment Caching.................................... 237 16.5 The Low-Level Cache API..................................... 237 16.6 Upstream Caches.......................................... 239 16.7 Using Vary Headers......................................... 239 16.8 Controlling Cache: Using Other Headers............................. 241 16.9 Other Optimizations......................................... 242 16.10 Order of MIDDLEWARE_CLASSES............................... 242 16.11 What’s Next?............................................ 242 17 Chapter 16: django.contrib 243 17.1 The Django Standard Library................................... 243 17.2 Sites.................................................. 244 iii 17.3 Flatpages............................................... 249 17.4 Redirects............................................... 252 17.5 CSRF Protection.......................................... 253 17.6 Humanizing Data.......................................... 255 17.7 Markup Filters............................................ 256 17.8 What’s Next?............................................ 257 18 Chapter 17: Middleware 259 18.1 What’s Middleware?......................................... 259 18.2 Middleware Installation....................................... 260 18.3 Middleware Methods........................................ 260 18.4 Built-in Middleware......................................... 262 18.5 What’s Next?............................................ 264 19 Chapter 18: Integrating with Legacy Databases and
Recommended publications
  • Declarative Languages for Big Streaming Data a Database Perspective
    Tutorial Declarative Languages for Big Streaming Data A database Perspective Riccardo Tommasini Sherif Sakr University of Tartu Unversity of Tartu [email protected] [email protected] Emanuele Della Valle Hojjat Jafarpour Politecnico di Milano Confluent Inc. [email protected] [email protected] ABSTRACT sources and are pushed asynchronously to servers which are The Big Data movement proposes data streaming systems to responsible for processing them [13]. tame velocity and to enable reactive decision making. However, To facilitate the adoption, initially, most of the big stream approaching such systems is still too complex due to the paradigm processing systems provided their users with a set of API for shift they require, i.e., moving from scalable batch processing to implementing their applications. However, recently, the need for continuous data analysis and pattern detection. declarative stream processing languages has emerged to simplify Recently, declarative Languages are playing a crucial role in common coding tasks; making code more readable and main- fostering the adoption of Stream Processing solutions. In partic- tainable, and fostering the development of more complex appli- ular, several key players introduce SQL extensions for stream cations. Thus, Big Data frameworks (e.g., Flink [9], Spark [3], 1 processing. These new languages are currently playing a cen- Kafka Streams , and Storm [19]) are starting to develop their 2 3 4 tral role in fostering the stream processing paradigm shift. In own SQL-like approaches (e.g., Flink SQL , Beam SQL , KSQL ) this tutorial, we give an overview of the various languages for to declaratively tame data velocity. declarative querying interfaces big streaming data.
    [Show full text]
  • Kodai: a Software Architecture and Implementation for Segmentation
    University of Rhode Island DigitalCommons@URI Open Access Master's Theses 2017 Kodai: A Software Architecture and Implementation for Segmentation Rick Rejeleene University of Rhode Island, [email protected] Follow this and additional works at: https://digitalcommons.uri.edu/theses Recommended Citation Rejeleene, Rick, "Kodai: A Software Architecture and Implementation for Segmentation" (2017). Open Access Master's Theses. Paper 1107. https://digitalcommons.uri.edu/theses/1107 This Thesis is brought to you for free and open access by DigitalCommons@URI. It has been accepted for inclusion in Open Access Master's Theses by an authorized administrator of DigitalCommons@URI. For more information, please contact [email protected]. KODAI: A SOFTWARE ARCHITECTURE AND IMPLEMENTATION FOR SEGMENTATION BY RICK REJELEENE A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS OF MASTER OF SCIENCE IN COMPUTER SCIENCE UNIVERSITY OF RHODE ISLAND 2017 MASTER OF SCIENCE THESIS OF RICK REJELEENE APPROVED: Thesis Committee: Major Professor: Joan Peckham Lisa DiPippo Ruby Dholakia Nasser H Zawia DEAN OF GRADUATE COMMITTEE UNIVERSITY OF RHODE ISLAND 2017 ABSTRACT The purpose of this thesis is to design and implement a software architecture for segmen- tation models to improve revenues for a supermarket. This tool supports analysis of su- permarket products and generates results to interpret consumer behavior, to give busi- nesses deeper insights into targeted consumer markets. The software design developed is named as Kodai. Kodai is horizontally reusable and can be adapted across various indus- tries. This software framework allows testing a hypothesis to address the problem of in- creasing revenues in supermarkets. Kodai has several advantages, such as analyzing and visualizing data, and as a result, businesses can make better decisions.
    [Show full text]
  • DARPA and Data: a Portfolio Overview
    DARPA and Data: A Portfolio Overview William C. Regli Special Assistant to the Director Defense Advanced Research Projects Agency Brian Pierce Director Information Innovation Office Defense Advanced Research Projects Agency Fall 2017 Distribution Statement “A” (Approved for Public Release, Distribution Unlimited) 1 DARPA Dreams of Data • Investments over the past decade span multiple DARPA Offices and PMs • Information Innovation (I2O): Software Systems, AI, Data Analytics • Defense Sciences (DSO): Domain-driven problems (chemistry, social science, materials science, engineering design) • Microsystems Technology (MTO): New hardware to support these processes (neuromorphic processor, graph processor, learning systems) • Products include DARPA Program testbeds, data and software • The DARPA Open Catalog • Testbeds include those in big data, cyber-defense, engineering design, synthetic bio, machine reading, among others • Multiple layers and qualities of data are important • Important for reproducibility; important as fuel for future DARPA programs • Beyond public data to include “raw” data, process/workflow data • Data does not need to be organized to be useful or valuable • Software tools are getting better eXponentially, ”raw” data can be processed • Changing the economics (Forensic Data Curation) • Its about optimizing allocation of attention in human-machine teams Distribution Statement “A” (Approved for Public Release, Distribution Unlimited) 2 Working toward Wisdom Wisdom: sound judgment - governance Abstraction Wisdom (also Understanding:
    [Show full text]
  • STORM: Refinement Types for Secure Web Applications
    STORM: Refinement Types for Secure Web Applications Nico Lehmann Rose Kunkel Jordan Brown Jean Yang UC San Diego UC San Diego Independent Akita Software Niki Vazou Nadia Polikarpova Deian Stefan Ranjit Jhala IMDEA Software Institute UC San Diego UC San Diego UC San Diego Abstract Centralizing policy specification is not a new idea. Several We present STORM, a web framework that allows developers web frameworks (e.g., HAILS [4], JACQUELINE [5], and to build MVC applications with compile-time enforcement of LWEB [6]) already do this. These frameworks, however, have centrally specified data-dependent security policies. STORM two shortcomings that have hindered their adoption. First, ensures security using a Security Typed ORM that refines the they enforce policies at run-time, typically using dynamic (type) abstractions of each layer of the MVC API with logical information flow control (IFC). While dynamic enforcement assertions that describe the data produced and consumed by is better than no enforcement, dynamic IFC imposes a high the underlying operation and the users allowed access to that performance overhead, since the system must be modified to data. To evaluate the security guarantees of STORM, we build a track the provenance of data and restrict where it is allowed formally verified reference implementation using the Labeled to flow. More importantly, certain policy violations are only IO (LIO) IFC framework. We present case studies and end-to- discovered once the system is deployed, at which point they end applications that show how STORM lets developers specify may be difficult or expensive to fix, e.g., on applications diverse policies while centralizing the trusted code to under 1% running on IoT devices [7].
    [Show full text]
  • FOSS Philosophy 6 the FOSS Development Method 7
    1 Published by the United Nations Development Programme’s Asia-Pacific Development Information Programme (UNDP-APDIP) Kuala Lumpur, Malaysia www.apdip.net Email: [email protected] © UNDP-APDIP 2004 The material in this book may be reproduced, republished and incorporated into further works provided acknowledgement is given to UNDP-APDIP. For full details on the license governing this publication, please see the relevant Annex. ISBN: 983-3094-00-7 Design, layout and cover illustrations by: Rezonanze www.rezonanze.com PREFACE 6 INTRODUCTION 6 What is Free/Open Source Software? 6 The FOSS philosophy 6 The FOSS development method 7 What is the history of FOSS? 8 A Brief History of Free/Open Source Software Movement 8 WHY FOSS? 10 Is FOSS free? 10 How large are the savings from FOSS? 10 Direct Cost Savings - An Example 11 What are the benefits of using FOSS? 12 Security 13 Reliability/Stability 14 Open standards and vendor independence 14 Reduced reliance on imports 15 Developing local software capacity 15 Piracy, IPR, and the WTO 16 Localization 16 What are the shortcomings of FOSS? 17 Lack of business applications 17 Interoperability with proprietary systems 17 Documentation and “polish” 18 FOSS SUCCESS STORIES 19 What are governments doing with FOSS? 19 Europe 19 Americas 20 Brazil 21 Asia Pacific 22 Other Regions 24 What are some successful FOSS projects? 25 BIND (DNS Server) 25 Apache (Web Server) 25 Sendmail (Email Server) 25 OpenSSH (Secure Network Administration Tool) 26 Open Office (Office Productivity Suite) 26 LINUX 27 What is Linux?
    [Show full text]
  • Multimedia Systems
    MVC Design Pattern Introduction to MVC and compare it with others Gholamhossein Tavasoli @ ZNU Separation of Concerns o All these methods do only one thing “Separation of Concerns” or “Layered Architecture” but in their own way. o All these concepts are pretty old, like idea of MVC was tossed in 1970s. o All these patterns forces a separation of concerns, it means domain model and controller logic are decoupled from user interface (view). As a result maintenance and testing of the application become simpler and easier. MVC Pattern Architecture o MVC stands for Model-View-Controller Explanation of Modules: Model o The Model represents a set of classes that describe the business logic i.e. business model as well as data access operations i.e. data model. o It also defines business rules for data means how the data can be created, sotored, changed and manipulated. Explanation of Modules: View o The View represents the UI components like CSS, jQuery, HTML etc. o It is only responsible for displaying the data that is received from the controller as the result. o This also transforms the model(s) into UI. o Views can be nested Explanation of Modules: Controller o The Controller is responsible to process incoming requests. o It receives input from users via the View, then process the user's data with the help of Model and passing the results back to the View. o Typically, it acts as the coordinator between the View and the Model. o There is One-to-Many relationship between Controller and View, means one controller can handle many views.
    [Show full text]
  • After the Storm After the Storm the Jobs and Skills That Will Drive the Post-Pandemic Recovery
    After the Storm After the Storm The Jobs and Skills that will Drive the Post-Pandemic Recovery February 2021 © Burning Glass Technologies 2021 1 After the Storm Table of Contents Table of Contents 1. Executive Summary pg 3 2. Introduction pg 6 3. The Readiness Economy pg 14 4. The Logistics Economy pg 16 5. The Green Economy pg 19 6. The Remote Economy pg 22 7. The Automated Economy pg 24 8. Implications pg 27 9. Methodology pg 29 10. Appendix pg 30 By Matthew Sigelman, Scott Bittle, Nyerere Hodge, Layla O’Kane, and Bledi Taska, with Joshua Bodner, Julia Nitschke, and Rucha Vankudre ©© BurningBurning GlassGlass TechnologiesTechnologies 20212021 22 After the Storm Executive Summary 1 Executive Summary The recession left in the wake of the • These jobs represent significant fractions COVID-19 pandemic is unprecedented. of the labor market: currently 13% of The changes have been so profound that demand and 10% of employment, but fundamental patterns of how we work, in addition they are important inflection produce, move, and sell will never be the points for the economy. A shortage same. of talent in these fields could set back broader recovery if organizations can’t If the U.S. is going to have a recovery that cope with these demands. not only brings the economy back to where • Jobs in these new “economies” are it was but also ensures a more equitable projected to grow at almost double the future, it is crucial to understand what jobs rate of the job market overall (15% vs. and skills are likely to drive the recovery.
    [Show full text]
  • Ascetic Documentation Release 0
    ascetic Documentation Release 0 Ivan Zakrevsky Mar 11, 2018 Contents 1 About 3 2 PostgreSQL Example 5 3 Configuring 7 4 Model declaration 9 4.1 Datamapper way.............................................9 4.2 ActiveRecord way............................................ 10 5 Retrieval 11 6 Updating 13 7 Deleting 15 8 SQLBuilder integration 17 9 Signals support 19 10 Web 21 11 Gratitude 23 12 Other projects 25 13 Indices and tables 27 i ii ascetic Documentation, Release 0 Ascetic exists as a super-lightweight datamapper ORM (Object-Relational Mapper) for Python. • Home Page: https://bitbucket.org/emacsway/ascetic • Docs: https://ascetic.readthedocs.io/ • Browse source code (canonical repo): https://bitbucket.org/emacsway/ascetic/src • GitHub mirror: https://github.com/emacsway/ascetic • Get source code (canonical repo): git clone https://bitbucket.org/emacsway/ascetic. git • Get source code (mirror): git clone https://github.com/emacsway/ascetic.git • PyPI: https://pypi.python.org/pypi/ascetic Contents 1 ascetic Documentation, Release 0 2 Contents CHAPTER 1 About Ascetic ORM based on “Data Mapper” pattern. It also supports “Active Record” pattern, but only as a wrapper, the model class is fully free from any service logic. Ascetic ORM follows the KISS principle. Has automatic population of fields from database (see the example below) and minimal size. You do not have to specify the columns in the class. This follows the DRY principle. Ascetic ORM as small as possible. Inside ascetic.contrib (currently under development) you can find the next solutions: • multilingual • polymorphic relations • polymorphic models (supports for “Single Table Inheritance”, “Concrete Table Inheritance” and “Class Table Inheritance” aka Django “Multi-table inheritance”) • “Materialized Path” implementation to handle tree structures • versioning (which stores only diff, not content copy) All extensions support composite primary/foreign keys.
    [Show full text]
  • Logic Networks on the Grid: Handling 15 Million Jobs
    Logic Networks on the Grid: Handling 15 Million Jobs Jan Bot, Delft Bioinformatics Lab 07-06-10 Delft University of Technology Challenge the future Overview • Explanation of the application • Challenges for the grid • Custom grid solution design & implementation • More challenges (aka problems) • Adding a desktop cluster • Errors and statistics • Discussion 2 But first... Does anybody not know what these are: • Life Science Grid • Grid middleware • ToPoS • ORM (Object Relational Mapper) 3 The application: overview Input data: ~100 mouse tumors 4 Grid pipeline • Prepare inputs: prepare data for future grid runs • Multiple parameter settings are tested, output of these tests contains the 'real' data • Choose best parameter settings, it should still be feasible to do at least 100 permutations • Do permutations, 10 permutations per run 5 Run properties • Number of jobs per run is fairly large: 24 * 6228 = 149472 • Run time is, due to the optimization algorithm, unpredictable: jobs can take anywhere between 2 seconds and 14 hours • Outputs are small, both for the real runs and for the permutations 6 Middleware problems • Scheduling: – This amount of jobs cannot be scheduled using the normal (glite) middleware – Overhead of scheduling could out-weight the run time • Bookkeeping – No method of tracking this amount of jobs • Output handling: – No grid resource can store large amounts of small files (dCache is not an option) – Other solutions (such as ToPoS) are slow when retrieving output 7 Scheduling jobs with ToPoS • ToPoS takes care of the
    [Show full text]
  • Dmitry Omelechko
    Dmitry Omelechko E-mail : [email protected] Phone : skype: dvarkin8 Address: Olevska 3 В, Kyiv, Ukraine Objective I have a more than 15 years of experience in IT industry, and I was involved in design and development of several long- term reliable, scalable and high-load platforms and applications, which gave me solid experience of software design. More than 10 years, I prefer functional programming and I have strong understanding of concurrent, scaled and parallel approaches. I'm good team player with strong self-motivation. I always do my best to build great solution for customers needs. Qualifications Programming Languages. Erlang/OTP Elixir/LFE (pet projects) Clojure / ClojureScript Python LISP (Alegro, SBCL) Perl C Data Science Recommendation Systems. DBMS PostgreSQL / EnterpriseDB / GreenPlum (PL/pgSQL, PL/Python). Riak MongoDB RethinkDB Cassandra Datomic KDB+ (pet) Hazelcast / Aerospike Redis / Memcache Application Servers and Frameworks Cowboy / Mochiweb / Ring / Runch Nginx / Apache / Haproxy RabbitMQ / 0mq / Kafka Storm / Samza Django/web.py/TurboGears/Plone/Zope Dmitry Omelechko 1 Histrix Riak / Redux / GraphQL / Om Next Ejabberd Erlyvideo / Flussonic AWS / Google Cloud / Heroku Networks OSPF/BGP/DNS/DHCP, VPNs, IPSec, Software Farewalls (Iptables, PF). Cisco/Extreme networks/Juniper routers and commutators. Clouds Google Cloud Amazon Cloud and AWS Heroku Operating Systems Ubuntu / Gentoo / Slackware OpenBSD Development Tools Emacs / Vim / IntelliJ Idea. git / svn / cvs Rebars / Erlang.mk / Leiningen EUnit / Common Test / Proper / Tsung Ansible / Terraform Methodologies Scrum / Kanban / TDD Work experience SBTech mar 2016 — present Tech Lead Data Science, Bets Recommendation System, User profiling system. Bet Engines sep 2015 — mar 2016 CTO Own startup. System for calculation huge Mathematical models in Excel.
    [Show full text]
  • Sql Update Statement with Select
    Sql Update Statement With Select Which Giffard sticking so demonstrably that Maxim pars her papain? Angled Jakob incurves unfalteringly and betimes, she arrests her steak accuses seducingly. Semiconscious Graham still wobbles: enjoyable and phototypic Ambrose flunk quite bang but gins her rakehells motherly. An error occurs if strict SQL mode is enabled otherwise the say is before to the. SQL UPDATE Statement SQL UPDATE Multiple Columns SQL UPDATE SELECT. The UPDATE statement FROM clause forbid a Teradata extension to the ANSI. Platform for selecting rows. SQL UPDATE Statement W3Schools. In update with the values match specified source render manager and smalldatetime data? How should UPDATE from background in SQL Server Tutorial Gateway. Exasol 70 SQL Reference SQL Statements Manipulation of Database DML. SQL UPDATE Statement A Complete Guide book Star. How to beyond a SQL Query plan UPDATE columns in inventory table by using the SELECT statement with their example This SQL Update wizard Select is devoid of the SQL. SQL UPDATE Statement with Examples Dofactory. Modifying Field Values with Update Queries UPDATE Query SQL Syntax. Gke app development management service catalog for update statement with sql select statement and a table is and may need to the query to learn how do. In with article title would link to king the most commonly used case expressions with update statements in SQL Server. UPDATE keyword table-ref AS t-alias value-assignment-statement FROM optimize-option select-table AS t-alias select-table2 AS t-alias WHERE. This UPDATE command will split whole data plot the specified column by. UPDATE Tableau Help.
    [Show full text]
  • Zope.Component Documentation Release 5.0.1
    zope.component Documentation Release 5.0.1 Zope Foundation Contributors Sep 24, 2021 Contents 1 Changes 3 2 Zope Component Architecture 11 3 The Zope 3 Component Architecture (Socket Example) 19 4 zope.component.events: Event dispatching 31 5 zope.component.factory: Object Creation Factories 35 6 zope.component.persistentregistry: Persistent Component Management 39 7 ZCML directives 41 8 Package configuration 61 9 zope.component.hooks: The current component registry 63 10 zope.component.testlayer: Test Layers 67 11 zope.component API Reference 71 12 Hacking on zope.component 105 13 Indices and tables 111 Python Module Index 113 Index 115 i ii zope.component Documentation, Release 5.0.1 Contents: Contents 1 zope.component Documentation, Release 5.0.1 2 Contents CHAPTER 1 Changes 1.1 5.0.1 (2021-07-09) • Fix unregistering utilities on old persistent adapter registries. Previously this could raise TypeError. See issue 62. 1.2 5.0.0 (2021-03-19) • Remove backwards compatibility imports that were emitting deprecation warnings. This affects certain imports from zope.component.interfaces (which should be imported from zope.interface. interfaces) as well as certain imports from zope.component.registery (import from zope. interface.registry), and the entire zope.component.hookable module. See issue 59. • Respect permission value for utility factory registrations (#54) • Add support for Python 3.9 • Fix the <subscriber> ZCML directive to allow a missing provides= attribute when a factory= is given and the Python object has been decorated with @implementer and implements a single interface. This has been documented, but hasn’t worked before. See issue 9.
    [Show full text]