Code Monkey home page Code Monkey logo

django-db-comments's People

Contributors

hartungstenio avatar letsolexandr avatar vanadium23 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-db-comments's Issues

generating DB comments from __doc__ special variable

  • Django Db Comments version: 0.2.2
  • Django version: 3.1
  • Python version: 3.8
  • Operating System: Windows 10 Pro

Description

This is a feature request: it would be possible to fetch the database comment not only from help_text and from verbose_name but also from the special __doc__ element attached to the column field? For instance, it would be great to do something like:

name = models.CharField(name='name', max_length=255, null=False)
"""
Name of the my awesome entity
"""

In this way we could fetch the help not only in the database, but also from the content assist (e.g., in PyCharm IDE) as well.

What do you think?

Error when migrate postgres tables with double quotes and schema in db_table ("foo"."buzz_buzz")

  • Django Db Comments version: 0.4.1
  • Django version: 3.2.4
  • Python version: 3.8
  • Operating System: Ubuntu 20.04

Description

pip install django-db-comments package.
python manage.py migrate

Got error for table "foo"."buzz_buzz"
django.db.utils.ProgrammingError: relation ""foo"."buzz_buzz"" does not exist

What I Did

Traceback (most recent call last):
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 81, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation ""lis"."document_types"" does not exist

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "manage.py", line 22, in
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/init.py", line 423, in execute_from_command_line
utility.execute()
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/init.py", line 417, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/base.py", line 368, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/base.py", line 412, in execute
output = self.handle(*args, **options)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/base.py", line 93, in wrapped
res = handle_func(*args, **kwargs)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/commands/migrate.py", line 284, in handle
emit_post_migrate_signal(
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/core/management/sql.py", line 37, in emit_post_migrate_signal
models.signals.post_migrate.send(
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 181, in send
return [(receiver, receiver(signal=self, sender=sender, **named)) for receiver in self._live_receivers(sender)]
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 181, in
return [(receiver, receiver(signal=self, sender=sender, **named)) for receiver in self._live_receivers(sender)]
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django_db_comments/db_comments.py", line 114, in copy_help_texts_to_database
add_column_comments_to_database(columns_comments, using)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django_db_comments/db_comments.py", line 57, in add_column_comments_to_database
cursor.execute(query, [comment])
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 96, in execute
return super().execute(sql, params)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 63, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 72, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 81, in _execute
return self.cursor.execute(sql, params)
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/home/nmaslov/PycharmProjects/lis-backend/venv/lib/python3.8/site-packages/django/db/backends/utils.py", line 81, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation ""lis"."document_types"" does not exist

Can it skip Proxy/Abstract model?

  • Django Db Comments version: 0.3.1
  • Django version: 3.2.11
  • Python version: 3.9.10, with django-pghistory 1.2.1
  • Operating System: MacOS 11.5.2 with docker images on Debian bullseye

Description

When migration, it failed showing database table is missing, however, it's a proxy model, it should not have any tables. Could django-db-comments skip proxy/abstract models?

class Meta:
    managed = False
    # or
    abstract = True
    # or
    proxy = True

What I Did

$ docker-compose -f local.yml run django python manage.py migrate
Starting redis   ... done
Starting mailhog ... done
Starting postgres ... done
PostgreSQL is available

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/pgconnection/core.py", line 85, in execute
    return super().execute(sql, args)
psycopg2.errors.UndefinedTable: relation "pghistory_aggregateevent" does not exist

LookupError with empty models.py file

  • Django Db Comments version: 0.3.1
  • Django version: 2.2
  • Python version: 3.7
  • Operating System: Ubuntu 20.04

Description

If the file models.py is empty in your app directory, migrations fail with LookupError. If you delete the file, the error disappears.

What I Did

python manage.py startapp newapp

Leave models.py empty and add 'newapp' to your INSTALLED_APPS.

python manage.py migrate

LookupError: No installed app with label 'newapp'.

Migrate to Github Action

Description

I've missed that, travi-ci.org will now have some free plans and has changed site. CI will be dropped in 7 week, so we need to move repo to Github Action.

Whether will support MySQL in the future

  • Django Db Comments version:
  • Django version:
  • Python version:
  • Operating System:

Description

I am using MySQL,I want to do the same thing,I don't know how to change it.

What I Did

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.