Pgadmin3 is the bomb. Try that gui tool On 16/12/2014 4:40 pm, "Shazwi Suwandi" <[email protected]> wrote:
> Hey guys, > > I figured it was a problem with the app I'm using for the db. I went to > use another app and now the tables are showing. Silly me. Thanks Mario and > David for your helpful advice. :) > > On Tuesday, 16 December 2014 13:33:36 UTC+8, Shazwi Suwandi wrote: >> >> Hey Mario, >> >> The output I get when I use makemigrations is >> >> 0001_initial.py: >> >> - Create model Member. >> >> I've double checked: >> >> >> - The 'Member' model is in core/models.py >> - 'Core' is inside project/settings.py >> >> I use python manage.py shell and I accessed the 'User' object and the >> linked 'Member' object to get the fields inside and it works. >> Furthermore, when I went to my db gui and try to delete the rows in the >> 'auth_user' table, it says that there is a constraint in 'core_member' >> table. >> >> Here's the link to the image that shows all the tables I have. >> http://i.imgur.com/M1ZWznt.png >> >> >> On Tuesday, 16 December 2014 11:18:58 UTC+8, somecallitblues wrote: >>> >>> What's the output of your makemigrations command? If those models are >>> inside core/models.py and your app is inside installed apps in settings >>> this should totally work. The default name for the table will be >>> appname_modelname. Do you get an error when accessing the model? How are >>> you checking the db for tables? >>> On 15/12/2014 11:00 pm, "Shazwi Suwandi" <[email protected]> wrote: >>> >>>> Hey David, >>>> >>>> You're right, I have to practise writing tests along with my codes. >>>> However, just to clarify, data input and output works. I can call the data >>>> in the Member object. I'm just confused as to why the Member table does not >>>> show up in my postgres database. It's weird. >>>> >>>> Nevertheless, I'll start writing unit tests. >>>> >>>> On Monday, 15 December 2014 19:03:23 UTC+8, David Palao wrote: >>>>> >>>>> Hello, >>>>> From your post I understand you did not write unittests for your >>>>> models? >>>>> I would recommend to write some sensible tests for them and start >>>>> tracing your problem from the failures you should get. >>>>> Best, >>>>> >>>>> David >>>>> >>>>> 2014-12-15 8:15 GMT+01:00 Shazwi Suwandi <[email protected]>: >>>>> > I've added 'core' to settings.py file under INSTALLED_APPS too. >>>>> > >>>>> > >>>>> > On Monday, 15 December 2014 15:10:12 UTC+8, Shazwi Suwandi wrote: >>>>> >> >>>>> >> from django.db import models >>>>> >> from django.contrib.auth.models import User >>>>> >> >>>>> >> # CORE APPLICATION >>>>> >> # Create your models here. >>>>> >> class Member(models.Model): >>>>> >> user = models.OneToOneField(User) >>>>> >> description = models.CharField(max_length=250) >>>>> >> date_of_birth = models.DateField() >>>>> >> location = models.CharField(max_length=100) >>>>> >> gender = models.CharField(max_length=15) >>>>> >> >>>>> >> class NewTable(models.Model): >>>>> >> test = models.CharField(max_length=25) >>>>> >> >>>>> >> I've created some models and I used makemigrations and migrate. I >>>>> went to >>>>> >> my db and checked that only the default tables are there >>>>> (auth_group ... >>>>> >> django_session). I know that my connection settings are right and >>>>> that I see >>>>> >> new rows being added to the auth_user table when I create users in >>>>> django >>>>> >> admin page. >>>>> >> >>>>> >> Is there something that I must have missed out? >>>>> > >>>>> > -- >>>>> > 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 [email protected]. >>>>> > To post to this group, send email to [email protected]. >>>>> > Visit this group at http://groups.google.com/group/django-users. >>>>> > To view this discussion on the web visit >>>>> > https://groups.google.com/d/msgid/django-users/7af04f16-09a8 >>>>> -458d-8857-c71694394101%40googlegroups.com. >>>>> > >>>>> > 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 [email protected]. >>>> To post to this group, send email to [email protected]. >>>> Visit this group at http://groups.google.com/group/django-users. >>>> To view this discussion on the web visit https://groups.google.com/d/ >>>> msgid/django-users/6dff229e-34c3-4e4f-bb34-f95c43bec18f% >>>> 40googlegroups.com >>>> <https://groups.google.com/d/msgid/django-users/6dff229e-34c3-4e4f-bb34-f95c43bec18f%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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/8a3453e1-386d-44d6-99a9-6bbf3f0ff7be%40googlegroups.com > <https://groups.google.com/d/msgid/django-users/8a3453e1-386d-44d6-99a9-6bbf3f0ff7be%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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHqTbj%3Dc7epwuz%2BoB%3DEt%3Dg0ZaMyoQtQEFFndA3VTC-zB4hF6eg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.

