Re: two errors in part 2

2020-08-25 Thread Максим
Hi, use double underscore before startswith and year: In [9]: Question.objects.filter(question_text*__**startswith*='What') In [12]: Question.objects.get(pub_date*__**year*=current_year) 26.08.2020 00:40, rbarh...@gmail.com пишет: Towards the end of part 2, I have encountered two errors that I

How to create complex gin index in postgres db using django

2018-08-29 Thread Максим Родин
Hello, I'm trying to make the text search index like this: https://www.postgresql.org/docs/current/static/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX: "CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', title || ' ' || body));" I cannot imagine how to do it in django Here is my

Re: Django Model

2018-05-30 Thread Максим С
ails" and "w" can be removed from the model itself, as they are > variables used only for retriving this information). Have a look how models > work here: https://docs.djangoproject.com/en/2.0/topics/db/models/ > > On Wed, May 30, 2018 at 11:12 AM, Максим С > wrote:

Django Model

2018-05-30 Thread Максим С
Hello all. I'm beginer. Sorry. Can anyone help me with this model. It did't work(TypeError: expected string or bytes-like object ): import whois class Domains(models.Model): domainname = models.CharField(max_length=200, blank=True) domainuser = models.ForeignKey(User, on_delete=model

Strange the global variable behavior

2018-01-23 Thread Максим Королёв
Hi there. Could someone explain what happens. I had a little project on Python 2.7 and decided to move it on 3.6. Everything has gone by perfectly. The project works well as before but there is one exception noticed by me: the global statement works not always. The code below doesn't update the

Strange the global variable behavior

2018-01-23 Thread Максим Королёв
Hi there. Could someone explain what happens. I had a little project on Python 2.7 and decided to move it on 3.6. Everything has gone by perfectly. The project works well as before but there is one exception noticed by me: the global statement works not always. The code below doesn't update the