peewee Documentation Release 3.0.0
Database Initializing a Database Using Postgresql Using SQLite Using MySQL Connecting using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Attributes Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 319 页 | 361.50 KB | 1 年前3peewee Documentation Release 2.10.2
and tables Using Postgresql Using SQLite Using BerkeleyDB Using MySQL Connecting using a Database URL Multi-threaded applications Run-time database configuration Dynamically defining a database Connection Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL CSV Utils Connection pool Read Slaves Test Utils pskel Flask Utils API Reference Models Fields Query user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 275 页 | 276.96 KB | 1 年前3peewee Documentation Release 2.10.2
mark the user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a similar login_required(f): @wraps(f) def inner(*args, **kwargs): if not session.get('logged_in'): return redirect(url_for('login')) 1.3. Example app 15 peewee Documentation, Release 2.10.2 return f(*args, **kwargs) Automatic Reconnect. 1.6.6 Connecting using a Database URL The playhouse module Database URL provides a helper connect() function that accepts a database URL and returns a Database instance. Example code:0 码力 | 221 页 | 844.06 KB | 1 年前3peewee Documentation Release 3.5.0
Database Initializing a Database Using Postgresql Using SQLite Using MySQL Connecting using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Examples Model Definitions Schema Creation Basic Exercises user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 347 页 | 380.80 KB | 1 年前3peewee Documentation Release 3.4.0
Database Initializing a Database Using Postgresql Using SQLite Using MySQL Connecting using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 349 页 | 382.34 KB | 1 年前3peewee Documentation Release 3.1.0
Database Initializing a Database Using Postgresql Using SQLite Using MySQL Connecting using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Attributes Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 332 页 | 370.77 KB | 1 年前3peewee Documentation Release 3.5.0
mark the user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a similar login_required(f): @wraps(f) def inner(*args, **kwargs): if not session.get('logged_in'): return redirect(url_for('login')) return f(*args, **kwargs) return inner • Return a 404 response instead of throwing .db') from urllib.parse import urlparse @db.func('hostname') def hostname(url): if url is not None: return urlparse(url).netloc # Call this function in our code: # The following finds the most common0 码力 | 282 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.3.0
mark the user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a similar login_required(f): @wraps(f) def inner(*args, **kwargs): if not session.get('logged_in'): return redirect(url_for('login')) return f(*args, **kwargs) return inner • Return a 404 response instead of throwing .db') from urllib.parse import urlparse @db.func('hostname') def hostname(url): if url is not None: return urlparse(url).netloc # Call this function in our code: # The following finds the most common0 码力 | 280 页 | 1.02 MB | 1 年前3peewee Documentation Release 3.4.0
mark the user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a similar login_required(f): @wraps(f) def inner(*args, **kwargs): if not session.get('logged_in'): return redirect(url_for('login')) return f(*args, **kwargs) return inner • Return a 404 response instead of throwing .db') from urllib.parse import urlparse @db.func('hostname') def hostname(url): if url is not None: return urlparse(url).netloc (continues on next page) 42 Chapter 1. Contents: peewee Documentation0 码力 | 284 页 | 1.03 MB | 1 年前3peewee Documentation Release 3.6.0
Database Initializing a Database Using Postgresql Using SQLite Using MySQL Connecting using a Database URL Run-time database configuration Dynamically defining a database Connection Management Connection Pooling Key/Value Store Shortcuts Signal support pwiz, a model generator Schema Migrations Reflection Database URL Connection pool Test Utils Flask Utils Query Examples Model Definitions Schema Creation Basic Exercises user as being 'authenticated' by setting the session vars auth_user(user) return redirect(url_for('homepage')) except IntegrityError: flash('That username is already taken') We will use a0 码力 | 377 页 | 399.12 KB | 1 年前3
共 16 条
- 1
- 2