peewee Documentation
Release 3.5.0usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: store arbitrary key/value pairs on House instances: >>> h = House.create( ... address='123 Main St', ... features={'garage': '2 cars', 'bath': '2 bath'}) ... >>> h_from_db = House.get(House.id ==0 码力 | 347 页 | 380.80 KB | 1 年前3
peewee Documentation Release 3.4.0facid)) List each member’s first booking after September 1st 2012 Produce a list of each member name, id, and their first booking after September 1st 2012. Order by member ID. SELECT m.surname, m.firstname usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set:0 码力 | 349 页 | 382.34 KB | 1 年前3
peewee Documentation Release 3.1.0facid)) List each member’s first booking after September 1st 2012 Produce a list of each member name, id, and their first booking after September 1st 2012. Order by member ID. SELECT m.surname, m.firstname usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set:0 码力 | 332 页 | 370.77 KB | 1 年前3
peewee Documentation
Release 3.5.0usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: now store arbitrary key/value pairs on House instances: >>> h = House.create( ... address='123 Main St', ... features={'garage': '2 cars', 'bath': '2 bath'}) ... >>> h_from_db = House.get(House.id ==0 码力 | 282 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.3.0facid)) List each member’s first booking after September 1st 2012 Produce a list of each member name, id, and their first booking after September 1st 2012. Order by member ID. SELECT m.surname, m.firstname usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set:0 码力 | 280 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 3.4.0facid)) List each member’s first booking after September 1st 2012 Produce a list of each member name, id, and their first booking after September 1st 2012. Order by member ID. SELECT m.surname, m.firstname peewee Documentation, Release 3.4.0 (continued from previous page) # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set:0 码力 | 284 页 | 1.03 MB | 1 年前3
peewee Documentation Release 3.0.0facid)) List each member’s first booking after September 1st 2012 Produce a list of each member name, id, and their first booking after September 1st 2012. Order by member ID. SELECT m.surname, m.firstname usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: store arbitrary key/value pairs on House instances: >>> h = House.create( ... address='123 Main St', ... features={'garage': '2 cars', 'bath': '2 bath'}) ... >>> h_from_db = House.get(House.id ==0 码力 | 319 页 | 361.50 KB | 1 年前3
peewee Documentation Release 3.6.0usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. Parameters: Parameters: Parameters: Returns: Parameters: Returns: store arbitrary key/value pairs on House instances: >>> h = House.create( ... address='123 Main St', ... features={'garage': '2 cars', 'bath': '2 bath'}) ... >>> h_from_db = House.get(House.id ==0 码力 | 377 页 | 399.12 KB | 1 年前3
peewee Documentation
Release 3.6.0usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: usage: class Bitmap(Model): data = BigBitField() bitmap = Bitmap() # Sets the ith bit, e.g. the 1st bit, the 11th bit, the 63rd, etc. bits_to_set = (1, 11, 63, 31, 55, 48, 100, 99) for bit_idx in bits_to_set: now store arbitrary key/value pairs on House instances: >>> h = House.create( ... address='123 Main St', ... features={'garage': '2 cars', 'bath': '2 bath'}) ... >>> h_from_db = House.get(House.id ==0 码力 | 302 页 | 1.02 MB | 1 年前3
peewee Documentation
Release 2.0.2can now store arbitrary key/value pairs on House instances: >>> h = House.create(address=’123 Main St’, features={’garage’: ’2 cars’, ’bath’: ’2 bath’}) >>> h_from_db = House.get(House.id == h.id) >>> print h.address, h.keys 123 Main St [u’bath’, u’garage’] >>> for h in House.select(House.address, f.values().alias(’vals’)): ... print h.address, h.vals 123 Main St [u’2 bath’, u’2 cars’] >>> for h h in House.select(House.address, f.items().alias(’mtx’)): ... print h.address, h.mtx 123 Main St [[u’bath’, u’2 bath’], [u’garage’, u’2 cars’]] You can retrieve a slice of data, for example, all the garage0 码力 | 65 页 | 315.33 KB | 1 年前3
共 14 条
- 1
- 2













