Re: updating model breaks admin

2018-04-30 Thread Gloria Elena
Hi George,

Thanks for the advice. I tried both suggestions and I am still getting the
same errors.

Here is my articles app structure and admin.py:


And here is my site structure:


Thank you!!


On Sun, Apr 29, 2018 at 11:50 PM, George Lubaretsi 
wrote:

> If the data is not important, try to delete migration files from
> `migrations` package, drop the database tables and reference M2M
> relationship using strings:
>
> tags = models.ManyToManyField('Tag')
>
> Or if the Tag model is in another app:
>
> tags = models.ManyToManyField('app_name.Tag')
>
> Then run `makemigrations` and `migrate`
>
> Can you also share the `Tag` model and related `ModelAdmin` classes?
>
> --
> 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/9d251f4a-b4ea-48b0-946b-458ea6f2957d%40googlegroups.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
-

Gloria Jimenez
Jr. Software Developer

 

-- 
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/CADOCafiPg0-jtFMCLOKVufth_D2_3Ttzw9xsc2OkZWP_HZ62ww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


updating model breaks admin

2018-04-29 Thread Gloria Elena
Hi all,

I want to request your help and I am sure you can guess by the question
that I am fairly new to Django and THANK YOU IN ADVANCE, I would like to,
someday, publish this portfolio website. I am sure I am making such a
rookie mistake and will have to kick myself for making such a silly error
but I am stuck !! Hope to pay it forward.

*I have this model in the articles app that works great: *

class Article(models.Model):
title = models.CharField(max_length=120, unique=True)
body=models.TextField(max_length=600)
date=models.DateField()
created = models.DateField(auto_now_add=True)
featured=models.BooleanField(default=False)
slug = models.SlugField(blank=True)


*UNTIL I add a new class and add this field:*

tags = models.ManyToManyField(Tag)


*Error message when adding a new article in admin:*


* OperationalError at /admin/articles/article/add/cursor
"_django_curs_5508_1" does not exist Error message when adding a new tag in
admin: *


* ProgrammingError at /admin/articles/tag/add/relation "articles_tag" does
not exist LINE 1: SELECT (1) AS "a" FROM "articles_tag" WHERE
"articles_tag".".. What I have tried to no avail:1) deleting all articles2)
migrate & makemigrations 3) deleting any references to tags in my
templates4) searching these errors on stackoverflow *

-- 
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/CADOCafiMBCKrFqNQdzf1teXkYO7SmjMK9kN__T3-XXdp5one%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.