|
1 | | -title: django.db.models TextField Example Code |
| 1 | +title: django.db.models TextField Python Example Code |
2 | 2 | category: page |
3 | 3 | slug: django-db-models-textfield-examples |
4 | 4 | sortorder: 50102 |
@@ -575,3 +575,45 @@ auditlog.register(PostgresArrayFieldModel) |
575 | 575 | auditlog.register(NoDeleteHistoryModel) |
576 | 576 | ``` |
577 | 577 |
|
| 578 | + |
| 579 | +## Example 4 from django-sql-explorer |
| 580 | +[django-sql-explorer](https://github.com/groveco/django-sql-explorer) |
| 581 | +([PyPI page](https://pypi.org/project/django-sql-explorer/0.2/)), |
| 582 | +also referred to as "SQL Explorer", |
| 583 | +is a code library for the [Django](/django.html) Admin that allows |
| 584 | +approved, authenticated users to view and execute direct database SQL |
| 585 | +queries. The tool keeps track of executed queries so users can share them |
| 586 | +with each other, as well as export results to downloadable formats. |
| 587 | +django-sql-explorer is provided as open source under the |
| 588 | +[MIT license](https://github.com/groveco/django-sql-explorer/blob/master/LICENSE). |
| 589 | + |
| 590 | +[**django-sql-explorer / explorer / migrations / 0002_auto_20150501_1515.py**](https://github.com/groveco/django-sql-explorer/blob/master/explorer/migrations/0002_auto_20150501_1515.py) |
| 591 | + |
| 592 | +```python |
| 593 | +# -*- coding: utf-8 -*- |
| 594 | +from __future__ import unicode_literals |
| 595 | + |
| 596 | +~~from django.db import models, migrations |
| 597 | + |
| 598 | + |
| 599 | +class Migration(migrations.Migration): |
| 600 | + |
| 601 | + dependencies = [ |
| 602 | + ('explorer', '0001_initial'), |
| 603 | + ] |
| 604 | + |
| 605 | +~~ operations = [ |
| 606 | +~~ migrations.RemoveField( |
| 607 | +~~ model_name='querylog', |
| 608 | +~~ name='is_playground', |
| 609 | +~~ ), |
| 610 | +~~ migrations.AlterField( |
| 611 | +~~ model_name='querylog', |
| 612 | +~~ name='sql', |
| 613 | +~~ field=models.TextField(null=True, blank=True), |
| 614 | +~~ ), |
| 615 | +~~ ] |
| 616 | + |
| 617 | +``` |
| 618 | + |
| 619 | + |
0 commit comments