Re: unsupported opperand type(s)

2014-08-04 Thread Collin Anderson
If you have no data that is important, I'd just delete the database and start fresh. If you're using sqlite you can simply `rm db.sqlite3` and then run python manage.py migrate again. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscr

Re: unsupported opperand type(s)

2014-08-04 Thread Mariusz Wilk
Django-1.6.5 W dniu poniedziałek, 4 sierpnia 2014 13:34:41 UTC+1 użytkownik Collin Anderson napisał: > > What version of django are you using? > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: unsupported opperand type(s)

2014-08-04 Thread Collin Anderson
What version of django are you using? -- 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 emai

Re: unsupported opperand type(s)

2014-08-04 Thread Mariusz Wilk
Kinda worked. I deleted my Poll objects and created a new one. But then, a few more lines into the tutorial, there are these commands one after another: p = Poll.objects.get(pk=1) p.choice_set.all() I get: *OperationalError: no such column: polls_choice.choice_text* It should be simply: []

Re: unsupported opperand type(s)

2014-08-02 Thread Collin Anderson
What version of python are you using (2 or 3)? Poll.objects.all().delete() will delete all of your Poll objects, if you want. Or it may be simpler to just rm db.sqlite3 and run manage.py migrate/syncdb again. -- You received this message because you are subscribed to the Google Groups "Django

Re: unsupported opperand type(s)

2014-08-02 Thread Mariusz Wilk
But when I enter: p = Poll(id=1, question="What's new?", pub_date=timezone.now()) p.save() and then enter: Poll.objects.filter(question__startswith='What') it should return: [] but it returns: [, , ] ..and so other commands form the tutorial also return things completely different from wh

Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson
p.id == 3 is just fine. It's auto-incrementing, and even if you delete items, an object will never get p.id == 1 again. If you really want a Poll with id=1, either clear out your database, or create it manually like so: p = Poll(id=1, question="What's new?", pub_date=timezone.now()) p.save() --

Re: unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
thanks, that helped I also got confused and created too many objects, so now instead of p.id "1" cdm returns "3". How do I delete objects from p? >>> from django.utils import timezone>>> p = Poll(question="What's new?", >>> pub_date=timezone.now()) # Save the object into the database. You ha

Re: unsupported opperand type(s)

2014-08-01 Thread Collin Anderson
> > def was_published_recently(self): > return self.pub_date >= timezone.now - datetime.timedelta(days=1) > timezone.now() -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails fro

unsupported opperand type(s)

2014-08-01 Thread Mariusz Wilk
Hi guys. I'm just going through the official tutorial for Django: "Writing your first Django app, part 1" At the bottom of the page it says: # Make sure our custom method worked. >>> p = Poll.objects.get(pk=1) >>> p.was_published_recently() True So far everything went well but now cmd retur