Mr Tom thanks very much. It has helped me alot On Jul 6, 2018 1:27 PM, "TimT Vogt" <timtv...@gmail.com> wrote:
> Try this > > https://www.valentinog.com/blog/django-missing-argument-on-delete/ > > Verstuurd vanaf mijn iPhone > > Op 6 jul. 2018 om 14:55 heeft Umar Kambala <umarkamb...@gmail.com> het > volgende geschreven: > > mr Tim can u help? > i have this codes but gets error > > from django.db import models > from django.contrib.auth.models import User > > > class Board(models.Model): > name = models.CharField(max_length=30, unique=True) > description = models.CharField(max_length=100) > > > class Topic(models.Model): > subject = models.CharField(max_length=255) > last_updated = models.DateTimeField(auto_now_add=True) > board = models.ForeignKey(Board, related_name='topics') > starter = models.ForeignKey(User, related_name='topics') > on_delete = models.PROTECT > > > class Post(models.Model): > message = models.TextField(max_length=4000) > topic = models.ForeignKey(Topic, related_name='posts') > created_at = models.DateTimeField(auto_now_add=True) > updated_at = models.DateTimeField(null=True) > created_by = models.ForeignKey(User, related_name='posts') > updated_by = models.ForeignKey(User, null=True, related_name='+') > on_delete = models.PROTECT > > this is the error message > > File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\ > lib\site-packages\django\core\management\__init__.py", line 371, in > execute_from_command_line > utility.execute() > File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\ > lib\site-packages\django\core\management\__init__.py", line 347, in > execute > django.setup() > File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\ > lib\site-packages\django\__init__.py", line 24, in setup > apps.populate(settings.INSTALLED_APPS) > File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\ > lib\site-packages\django\apps\registry.py", line 112, in populate > app_config.import_models() > File "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\ > lib\site-packages\django\apps\config.py", line 198, in import_models > self.models_module = import_module(models_module_name) > File > "C:\Users\Admin\AppData\Local\Programs\Python\Python36-32\lib\importlib\__init__.py", > line 126, in import_module > return _bootstrap._gcd_import(name[level:], package, level) > File "<frozen importlib._bootstrap>", line 994, in _gcd_import > File "<frozen importlib._bootstrap>", line 971, in _find_and_load > File "<frozen importlib._bootstrap>", line 955, in > _find_and_load_unlocked > File "<frozen importlib._bootstrap>", line 665, in _load_unlocked > File "<frozen importlib._bootstrap_external>", line 678, in exec_module > File "<frozen importlib._bootstrap>", line 219, in > _call_with_frames_removed > File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", > line 10, in <module> > class Topic(models.Model): > File "C:\Users\Admin\Desktop\Django Web\myproject\boards\models.py", > line 13, in Topic > board = models.ForeignKey(Board, related_name='topics') > TypeError: __init__() missing 1 required positional argument: 'on_delete' > > On Thu, Jul 5, 2018 at 12:40 PM, Tim Vogt <timtv...@gmail.com> wrote: > >> For a blog page with user friendly ux >> >> why choose one over another? >> >> Django of django Wagtail? >> >> What make the one better than the other? >> >> thanx! >> >> Tim >> t...@officerebels.nl >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/django-users/01ad0564-d0b4-40ea-9287-337878c2fe13%40googlegroups.com >> <https://groups.google.com/d/msgid/django-users/01ad0564-d0b4-40ea-9287-337878c2fe13%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/CAPkbFbaR%2BVjUJN1V_Nfw%2B%3DdVTewcKsWYzjYRT%2B_yc0X8_ > b83CQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAPkbFbaR%2BVjUJN1V_Nfw%2B%3DdVTewcKsWYzjYRT%2B_yc0X8_b83CQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at https://groups.google.com/group/django-users. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-users/D42C9244-B02D-4CAA-B369-FEF7AF22C432%40gmail.com > <https://groups.google.com/d/msgid/django-users/D42C9244-B02D-4CAA-B369-FEF7AF22C432%40gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAPkbFbZtN8OhjnvHpWvjvL0krjTBtsg%3D7FwaNm7VvrdLwwzwvA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.