peewee Documentation Release 3.0.0Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries More Hacks Optimistic Locking Top object per group Top N objects per group Writing custom dies. We need to remove him from the database: herb_mittens.delete_instance() # he had a great life # Returns: 1 Note The return value of delete_instance() is the number of rows removed from the database 'Tennis Court 2')) Delete all bookings As part of a clearout of our database, we want to delete all bookings from the bookings table. DELETE FROM bookings; query = Booking.delete() Delete a member from0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.4.0Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Top object per group Top N objects per group dies. We need to remove him from the database: herb_mittens.delete_instance() # he had a great life # Returns: 1 Note The return value of delete_instance() is the number of rows removed from the database 'Tennis Court 2')) Delete all bookings As part of a clearout of our database, we want to delete all bookings from the bookings table. DELETE FROM bookings; query = Booking.delete() Delete a member from0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation
Release 3.5.0Aggregation Recursion Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Top object per group Top N objects per group dies. We need to remove him from the database: herb_mittens.delete_instance() # he had a great life # Returns: 1 Note The return value of delete_instance() is the number of rows removed from the database db = SqliteDatabase(':memory:') with db.transaction() as txn: # Delete the user and their associated tweets. user.delete_instance(recursive=True) Transactions can be explicitly committed or rolled-back0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.1.0Test Utils Flask Utils Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Top object per group Top N objects per group dies. We need to remove him from the database: herb_mittens.delete_instance() # he had a great life # Returns: 1 Note The return value of delete_instance() is the number of rows removed from the database 'Tennis Court 2')) Delete all bookings As part of a clearout of our database, we want to delete all bookings from the bookings table. DELETE FROM bookings; query = Booking.delete() Delete a member from0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation Release 3.6.0Aggregation Recursion Query Builder Declaring tables Select queries Insert queries Update queries Delete queries Query Objects More Hacks Optimistic Locking Top object per group Top N objects per group dies. We need to remove him from the database: herb_mittens.delete_instance() # he had a great life # Returns: 1 Note The return value of delete_instance() is the number of rows removed from the database db = SqliteDatabase(':memory:') with db.transaction() as txn: # Delete the user and their associated tweets. user.delete_instance(recursive=True) Transactions can be explicitly committed or rolled-back0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation Release 2.10.2dies. We need to remove him from the database: >>> herb_mittens.delete_instance() # he had a great life 1 Note The return value of delete_instance() is the number of rows removed from the database. Uncle max_digits, decimal_places, auto_round, rounding ForeignKeyField rel_model, related_name, to_field, on_delete, on_update, extra BareField coerce Note Both default and choices could be implemented at the database models without a primary key, for instance save() and ~Model.delete_instance (you can instead use ~Model.insert, ~Model.update and ~Model.delete). Self-referential foreign keys When creating a heirarchical0 码力 | 275 页 | 276.96 KB | 1 年前3
peewee Documentation Release 1.0.0on UpdateQuery. Deleting a record To delete a single model instance, you can use the Model.delete_instance() shortcut: >>> blog = Blog.get(id=1) >>> blog.delete_instance() 1 # <--- number of rows deleted 1 PARAMS: [1] To delete an arbitrary group of records, you can issue a DELETE query. The following will delete all Entry objects that are a year old. >>> delete_query = Entry.delete().where(pub_date__lt=one_year_ago) where(pub_date__lt=one_year_ago) >>> delete_query.execute() 7 # <--- number of entries deleted For more information, see the documentation on DeleteQuery. Selecting a single record You can use the Model.get() method0 码力 | 101 页 | 163.20 KB | 1 年前3
CakePHP Cookbook 2.x
creating and configuring a database, and creating enough application logic to list, add, edit, and delete blog posts. Here’s what you’ll need: 1. A running web server. We’re going to assume you’re using interact with our database, we’ll have the foundation in place needed to do our view, add, edit, and delete operations later. CakePHP’s model class files go in /app/Model, and the file we’ll be creating will Note $this->request->is() takes a single argument, which can be the request METHOD (get, put, post, delete) or some request identifier (ajax). It is not a way to check for specific posted data. For instance0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook Documentation 5.xSimple Slug Generation Add Edit Action Create Edit Template Update Validation Rules for Articles Add Delete Action Migration Guides 5.0 Upgrade Guide Fix Deprecation Warnings Upgrade to PHP 8.1 Use the Simple Slug Generation Add Edit Action Create Edit Template Update Validation Rules for Articles Add Delete Action CMS Tutorial - Tags and Users Adding Tagging to Articles Updating Articles to Enable Tagging ServerRequest Request Parameters Query String Parameters Request Body Data File Uploads PUT, PATCH or DELETE Data Environment Variables (from $_SERVER and $_ENV) XML or JSON Data Path Information Checking0 码力 | 1080 页 | 939.39 KB | 1 年前3
Django 4.2.x DocumentationChanging a ManyToManyField to use a through model Changing an unmanaged model to managed How to delete a Django application Django FAQ FAQ: General Why does this project exist? What does “Django” mean CharField(max_length=200) content = models.TextField() reporter = models.ForeignKey(Reporter, on_delete=models.CASCADE) def __str__(self): return self.headline Install it Next, run the Django attributes and calling save(). >>> r.full_name = "Billy Goat" >>> r.save() # Delete an object with delete(). >>> r.delete() A dynamic admin interface: it’s not just scaffolding – it’s the whole house0 码力 | 3305 页 | 3.16 MB | 1 年前3
共 603 条
- 1
- 2
- 3
- 4
- 5
- 6
- 61













