From 08b80cef7723819c22dae53c4ff7f45c4fc8c518 Mon Sep 17 00:00:00 2001 From: Vikash Singh <3116482+vi3k6i5@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:39:03 +0530 Subject: [PATCH] Docs: fix changelog link and sample examples. (#700) * docs: update docs to show decimal field support and check constraints but no support for unsigned data type * docs: linked changelog correctly * docs: fix doc links for sample examples * fix: skip test cursor_executemany_with_empty_params_list as spanner support is not there --- django_spanner/features.py | 2 ++ docs/changelog.md | 2 +- docs/example_from_scratch.md | 1 + docs/example_healthchecks.md | 1 + docs/samples.rst | 30 +++++++++--------------------- 5 files changed, 14 insertions(+), 22 deletions(-) mode change 100644 => 120000 docs/changelog.md create mode 120000 docs/example_from_scratch.md create mode 120000 docs/example_healthchecks.md diff --git a/django_spanner/features.py b/django_spanner/features.py index 050ba9c7b9..a0ae6299c3 100644 --- a/django_spanner/features.py +++ b/django_spanner/features.py @@ -38,6 +38,8 @@ class DatabaseFeatures(BaseDatabaseFeatures): skip_tests = ( # No foreign key constraints in Spanner. "backends.tests.FkConstraintsTests.test_check_constraints", + # Spanner does not support empty list of DML statement. + "backends.tests.BackendTestCase.test_cursor_executemany_with_empty_params_list", "fixtures_regress.tests.TestFixtures.test_loaddata_raises_error_when_fixture_has_invalid_foreign_key", # No Django transaction management in Spanner. "basic.tests.SelectOnSaveTests.test_select_on_save_lying_update", diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index 825c32f0d0..0000000000 --- a/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -# Changelog diff --git a/docs/changelog.md b/docs/changelog.md new file mode 120000 index 0000000000..04c99a55ca --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/example_from_scratch.md b/docs/example_from_scratch.md new file mode 120000 index 0000000000..1e40292b5e --- /dev/null +++ b/docs/example_from_scratch.md @@ -0,0 +1 @@ +../examples/from-scratch/README.md \ No newline at end of file diff --git a/docs/example_healthchecks.md b/docs/example_healthchecks.md new file mode 120000 index 0000000000..08983d890b --- /dev/null +++ b/docs/example_healthchecks.md @@ -0,0 +1 @@ +../examples/healthchecks/README.md \ No newline at end of file diff --git a/docs/samples.rst b/docs/samples.rst index 3e20575e24..09d8c37590 100644 --- a/docs/samples.rst +++ b/docs/samples.rst @@ -1,24 +1,12 @@ -Sample Code -#################################### +Sample Examples +############### -Create and register your first model -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To define your database layout create a models file in your app folder and add the relevant -classes to it. Spanner works exactly like any other database you may have used with Django. -Here is a simple example you can run with Spanner. In our poll application below we create -the following two models: +django-spanner for Django tutorial +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code:: python +This `Example `_ shows how to use django-spanner for Cloud Spanner as a backend database for `healthchecks.io `_ - from django.db import models - - class Question(models.Model): - question_text = models.CharField(max_length=200) - pub_date = models.DateTimeField('date published') - def __str__(self): - return str(self.rating) - - class Choice(models.Model): - question = models.ForeignKey(Question, on_delete=models.CASCADE) - choice_text = models.CharField(max_length=200) - votes = models.IntegerField(default=0) +django-spanner on healthchecks.io +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This `Example `_ shows how to use django-spanner for Cloud Spanner as a backend database for `Django's tutorials `_