Re: Python +django

2019-09-10 Thread 'Nicholas Hatch' via Django users
If you are looking for books, any of the O’Reilly books are good. A worthwhile 
investment is an O’Reilly online subscription, which gives you access to all 
their books plus video tutorials, so you get the best of both worlds.

For the price of three or four of their technical books, you get their full 
library, and if you really get into this, you’ll need to dive into many other 
topics anyway.

Nicholas Hatch

On Tue, Sep 10, 2019 at 1:03 PM, Gerardo Palazuelos Guerrero 
 wrote:

> hi,
> Django has been a different beast for me, an .NET programmer...
> You need to find your way...
>
> Following are my go-to resources, always:
> #1: (free) Djangogirls tutorial
> #2: (paid) the books by https://wsvincent.com/books/-- specially that 
> book (green one) is an excellent resource for beginners
> #3: (free to read online) Harry Percival's https://www.obeythetestinggoat.com/
>
> Note:
> I'm not affiliated or anything with those sites... it's just that those 
> materials are helpful for me and I keep mentioning those to folks
>
> --
> Gerardo Palazuelos Guerrero
>
> On Tue, Sep 10, 2019 at 7:25 AM Mario R. Osorio  wrote:
>
>> I must agree that video tutorials are harder to follow, specially if and 
>> when they are if at least a bit outdated. I used to hate them however; I've 
>> learned to appreciate them specially because of one reason: YOU CANNOT COPY 
>> AND PASTE.
>>
>> Written tutorials don't help you go thru the full learning process and make 
>> you a master of [Ctrl]-[C] & [Ctrl]-[V] since you're not even checking the 
>> code nor make sense out of it, let alone memorizing it.
>>
>> Back in the day, when written tutorials were handed to you on paper, 
>> probably as photocopy of some else's photocopy (bis), you would learn by 
>> typing the code yourself. It is online tutorials that I find not as helpful 
>> anymore.
>>
>> Now, don't get me wrong, I have found lost of excellent online tutorials. 
>> The problem is that it is all too easy to copy and paste.
>>
>> IMHO (and at least in programming) written tutorials are for the very first 
>> baby steps but once you've outpaced those; you need to move away from them, 
>> even if we are talking about learning a new programming language, tool, 
>> framework or paradigm.
>>
>> On Monday, September 9, 2019 at 7:59:07 AM UTC-4, ajoeiam wrote:
>>
>>> On Mon, Sep 9, 2019 at 6:33 AM selim atmaca  wrote:

 You should learn python basics first but dont dive deep, just the basics. 
 Then
 There is a nice django video series on youtube. Search for corey schafer 
 django. There are 17 videos in that series. If I was starting django 
 today, definetly I would start it with that video series.

>>> Hopefully this isn't a thread hijacking - - - - but - - - - -
>>> I am finding that online videos are hugely wasteful of time and would
>>> rather have a text equivalent.
>>> Is there such for this recommended video series?
>>>
>>> Regards
>>
>> --
>> 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 view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/django-users/65360234-aaa6-4365-9e8e-fc6d8a3bc5f2%40googlegroups.com](https://groups.google.com/d/msgid/django-users/65360234-aaa6-4365-9e8e-fc6d8a3bc5f2%40googlegroups.com?utm_medium=email_source=footer).
>
> --
> 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 view this discussion on the web visit 
> [https://groups.google.com/d/msgid/django-users/CAJ8iCyO7XsMj0JPd8Rj8-PXghPOaxoPnjNELr6e8J73wgvLCpA%40mail.gmail.com](https://groups.google.com/d/msgid/django-users/CAJ8iCyO7XsMj0JPd8Rj8-PXghPOaxoPnjNELr6e8J73wgvLCpA%40mail.gmail.com?utm_medium=email_source=footer).

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/P4PC8nOmfEd1JqWoqYlzVXO9qMS5Pne1LA1-wTlKy2cwoSlhD8wB28FIFg_bMwUkGVE249jJTynj_PBTqsxWaSudRTlG3FlDth8j-JCnfqE%3D%40thehatchcloud.org.


Re: Relation between different database?

2019-09-10 Thread ANi
Thanks, Jason.

I was trying to connect a table to a view from another database.
But it is not allowed to have a foreign key on a view unless I use a 
materialized view! 
Problem is solved. 




ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>
> Hi, 
>
> I have my asset table in local db which need to reference to the employee 
> view from another database. 
> But I realized that Django might not allow relations across databases, 
> right?
>
> so does it means that I can only store the employee key as string in the 
> asset table?
> or other way to achieve?
>
> many thanks,
> ANi
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/94f3298b-a879-49ae-ac5f-52f1f7d6109e%40googlegroups.com.


Re: django-import-export problem with relation of two databases

2019-09-10 Thread ANi
Thanks, Jason.
Then another question, actually why I am asking this is because I am using 
django-export-import, 
I think it is better to have another title.

This is my router, I've set the foreignkey between A Model from default 
database and EmpAXView from emp database.
django-export-import tells me this:
no such table: main.View_EmpAX
or the relation is not allowed.

so I am thinking it is the problem of allow_relation method. but I don't 
get the concept about how to write it..

[image: 擷取.PNG]


ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>
> Hi, 
>
> I have my asset table in local db which need to reference to the employee 
> view from another database. 
> But I realized that Django might not allow relations across databases, 
> right?
>
> so does it means that I can only store the employee key as string in the 
> asset table?
> or other way to achieve?
>
> many thanks,
> ANi
>

ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>
> Hi, 
>
> I have my asset table in local db which need to reference to the employee 
> view from another database. 
> But I realized that Django might not allow relations across databases, 
> right?
>
> so does it means that I can only store the employee key as string in the 
> asset table?
> or other way to achieve?
>
> many thanks,
> ANi
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/19635e18-c095-4cf4-93fa-336a07cb9908%40googlegroups.com.


Re:

2019-09-10 Thread Duncan Jerry
exactly @Jani Tianien.. I strongly suggest that code snippet be snapped
from whatever framework for easy understanding

On Tue, Sep 10, 2019 at 2:07 PM Jani Tiainen  wrote:

> Please paste your errors as plain text.
>
> Images are really hard to read in mobile devices and searching image for
> keywords is really impossible.
>
> ti 10. syysk. 2019 klo 23.36 Duncan Jerry 
> kirjoitti:
>
>> you should post images of the errors you are getting so that its easy for
>> us to figure out a solution for you
>>
>> On Tue, Sep 10, 2019 at 1:09 PM Abhishek Ghaskata <
>> abhishekghaskata1...@gmail.com> wrote:
>>
>>> I am getting error models has no 'objects' member.
>>> So what should I do?
>>>
>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/CA%2B5xdHPwjnyUVC_gw-QS9SW75RFj6obHvNJkKrwxtKSSmZQMzg%40mail.gmail.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAA8zVqug8iPVo3V2CB_A5tqTVVo1NQyU8Tk07VqH8kQbjj2kfA%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAHn91ofa9s0CHEKPcCjuY8EqJYMNxPqLryBTE5ghSScdvc6cMQ%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA8zVquG%2Bjabojq0XfOAsi3Sc9X%2Bh_H37MXAMT9%3DP8qXF9FTJw%40mail.gmail.com.


Re:

2019-09-10 Thread Jani Tiainen
Please paste your errors as plain text.

Images are really hard to read in mobile devices and searching image for
keywords is really impossible.

ti 10. syysk. 2019 klo 23.36 Duncan Jerry 
kirjoitti:

> you should post images of the errors you are getting so that its easy for
> us to figure out a solution for you
>
> On Tue, Sep 10, 2019 at 1:09 PM Abhishek Ghaskata <
> abhishekghaskata1...@gmail.com> wrote:
>
>> I am getting error models has no 'objects' member.
>> So what should I do?
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CA%2B5xdHPwjnyUVC_gw-QS9SW75RFj6obHvNJkKrwxtKSSmZQMzg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA8zVqug8iPVo3V2CB_A5tqTVVo1NQyU8Tk07VqH8kQbjj2kfA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAHn91ofa9s0CHEKPcCjuY8EqJYMNxPqLryBTE5ghSScdvc6cMQ%40mail.gmail.com.


Re:

2019-09-10 Thread Duncan Jerry
you should post images of the errors you are getting so that its easy for
us to figure out a solution for you

On Tue, Sep 10, 2019 at 1:09 PM Abhishek Ghaskata <
abhishekghaskata1...@gmail.com> wrote:

> I am getting error models has no 'objects' member.
> So what should I do?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CA%2B5xdHPwjnyUVC_gw-QS9SW75RFj6obHvNJkKrwxtKSSmZQMzg%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA8zVqug8iPVo3V2CB_A5tqTVVo1NQyU8Tk07VqH8kQbjj2kfA%40mail.gmail.com.


Re: Postgre sql problem

2019-09-10 Thread acema alex
Try to follow these steps;
- Install PostgreSQL,
-install psycopg2 binary version ,
-create the database in the PostgreSQL,
- then go to your settings.py of your project and do these on the database
setting
DATABASES = {
'defaults': {
   'ENGINE': 'Django.db.backends.postgresql_psycopg2',
'NAME': ('DB_NAME'),
'USER': ('DB_USER'),
   'PASSWORD': ('DB_PASS'),
   'HOST' : 'localhost',
   'PORT': '5432',
}
}
Wish you the best in Codding.



On Tue, Sep 10, 2019 at 5:34 PM Team Infinity 
wrote:

> You must have postresql installed so as to install psycopg2 :)
>
> On Saturday, September 7, 2019 at 1:34:31 AM UTC+5:45, Elmaco7 wrote:
>>
>> *Hello, I'm trying to use Postresql with my django project, but when i
>> try to install psycopg2(with this command 'pip3 install psycopg2')  this
>> problem appears:*
>>
>> Collecting psycopg2
>>   Using cached
>> https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
>> Building wheels for collected packages: psycopg2
>>   Building wheel for psycopg2 (setup.py) ... error
>>   ERROR: Command errored out with exit status 1:
>>command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
>> sys, setuptools, tokenize; sys.argv[0] =
>> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
>> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> bdist_wheel -d /tmp/pip-wheel-mkc6kj2i --python-tag cp36
>>cwd: /tmp/pip-install-t391_oat/psycopg2/
>>   Complete output (40 lines):
>>   running bdist_wheel
>>   running build
>>   running build_py
>>   creating build
>>   creating build/lib.linux-x86_64-3.6
>>   creating build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
>>   running build_ext
>>   building 'psycopg2._psycopg' extension
>>   creating build/temp.linux-x86_64-3.6
>>   creating build/temp.linux-x86_64-3.6/psycopg
>>   x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g
>> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
>> -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64)
>> -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m
>> -I/home/user/myproject/myprojectenv/include/python3.6m -I.
>> -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c
>> psycopg/psycopgmodule.c -o
>> build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o
>> -Wdeclaration-after-statement
>>   In file included from psycopg/psycopgmodule.c:27:0:
>>   ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or
>> directory
>>#include 
>> ^~
>>   compilation terminated.
>>
>>   It appears you are missing some prerequisite to build the package from
>> source.
>>
>>   You may install a binary package by installing 'psycopg2-binary' from
>> PyPI.
>>   If you want to install psycopg2 from source, please install the packages
>>   required for the build and try again.
>>
>>   For further information please check the 'doc/src/install.rst' file
>> (also at
>>   ).
>>
>>   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>>   
>>   ERROR: Failed building wheel for psycopg2
>>   Running setup.py clean for psycopg2
>> Failed to build psycopg2
>> Installing collected packages: psycopg2
>>   Running setup.py install for psycopg2 ... error
>> ERROR: Command errored out with exit status 1:
>>  command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
>> sys, setuptools, tokenize; sys.argv[0] =
>> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
>> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
>> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
>> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
>> install 

Re: Postgre sql problem

2019-09-10 Thread Aniket Jain
Hello ,
Please pip install psycopg2

On Sat, 7 Sep, 2019, 1:19 AM Elmaco7,  wrote:

> *Hello, I'm trying to use Postresql with my django project, but when i try
> to install psycopg2(with this command 'pip3 install psycopg2')  this
> problem appears:*
>
> Collecting psycopg2
>   Using cached
> https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
> Building wheels for collected packages: psycopg2
>   Building wheel for psycopg2 (setup.py) ... error
>   ERROR: Command errored out with exit status 1:
>command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
> sys, setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-mkc6kj2i --python-tag cp36
>cwd: /tmp/pip-install-t391_oat/psycopg2/
>   Complete output (40 lines):
>   running bdist_wheel
>   running build
>   running build_py
>   creating build
>   creating build/lib.linux-x86_64-3.6
>   creating build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
>   running build_ext
>   building 'psycopg2._psycopg' extension
>   creating build/temp.linux-x86_64-3.6
>   creating build/temp.linux-x86_64-3.6/psycopg
>   x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64)
> -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m
> -I/home/user/myproject/myprojectenv/include/python3.6m -I.
> -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c
> psycopg/psycopgmodule.c -o
> build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o
> -Wdeclaration-after-statement
>   In file included from psycopg/psycopgmodule.c:27:0:
>   ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or
> directory
>#include 
> ^~
>   compilation terminated.
>
>   It appears you are missing some prerequisite to build the package from
> source.
>
>   You may install a binary package by installing 'psycopg2-binary' from
> PyPI.
>   If you want to install psycopg2 from source, please install the packages
>   required for the build and try again.
>
>   For further information please check the 'doc/src/install.rst' file
> (also at
>   ).
>
>   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>   
>   ERROR: Failed building wheel for psycopg2
>   Running setup.py clean for psycopg2
> Failed to build psycopg2
> Installing collected packages: psycopg2
>   Running setup.py install for psycopg2 ... error
> ERROR: Command errored out with exit status 1:
>  command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
> sys, setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-bl1kkv0m/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
>  cwd: /tmp/pip-install-t391_oat/psycopg2/
> Complete output (40 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-3.6
> creating build/lib.linux-x86_64-3.6/psycopg2
> copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/extensions.py 

[no subject]

2019-09-10 Thread Abhishek Ghaskata
I am getting error models has no 'objects' member.
So what should I do?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CA%2B5xdHPwjnyUVC_gw-QS9SW75RFj6obHvNJkKrwxtKSSmZQMzg%40mail.gmail.com.


Re: Problems with "Class Meta" and " __str__"

2019-09-10 Thread 'Amitesh Sahay' via Django users
I guess you should define the Meta class just under the main class, ie.
class Autore(models.Model):
    nome = models.CharField(max_length=50)
    cognome = models.CharField(max_length=50)
 class Meta:
    verbose_name_plural = "Autori"





Regards,
Amitesh Sahay91-750 797 8619 

On Tuesday, 10 September, 2019, 11:50:20 pm IST, Doddahulugappa.B 
 wrote:  
 
 def __str__(self):
    return self.name


On Tue, Sep 10, 2019, 8:30 PM Elmaco7  wrote:

Hello, I do these models but the Django admin page doesn't read the "class 
Meta" and " __str__".This is the models.py document

from django.db import models

# Create your models here.


class Autore(models.Model):
    nome = models.CharField(max_length=50)
    cognome = models.CharField(max_length=50)
def __str__(self):
    return self.autore_text
class Meta:
    verbose_name_plural = "Autori"

class Genere(models.Model):
    descrizione = models.CharField(max_length=30)
def __str__(self):
    return self.genere_text
class Meta:
    verbose_name_plural = "Generi"

class Libro(models.Model):
    titolo = models.CharField(max_length=200)
    autore = models.ForeignKey(Autore, on_delete=models.CASCADE)
    genere = models.ForeignKey(Genere, on_delete=models.CASCADE)
def __str__(self):
    return self.libro_text
class Meta:
    verbose_name_plural = "Libri"


These are the results



Can someone help me?


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c1941b52-7d2b-4b09-8ead-fce630b73757%40googlegroups.com.



-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKfjjGrMMEkg85LOVGhDeSes%3D4eMzoh%3DTn%2BwyS%2Bc5VxWMBMiPw%40mail.gmail.com.
  

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1997993869.4201313.1568141384098%40mail.yahoo.com.


Re: Problems with "Class Meta" and " __str__"

2019-09-10 Thread Doddahulugappa.B
*def __str__(self):return self.name *



On Tue, Sep 10, 2019, 8:30 PM Elmaco7  wrote:

> Hello, I do these models but the Django admin page doesn't read the "class
> Meta" and " __str__".
> This is the models.py document
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *from django.db import models# Create your models here.class
> Autore(models.Model):nome = models.CharField(max_length=50)cognome
> = models.CharField(max_length=50)def __str__(self):return
> self.autore_textclass Meta:verbose_name_plural = "Autori"class
> Genere(models.Model):descrizione = models.CharField(max_length=30)def
> __str__(self):return self.genere_textclass Meta:
> verbose_name_plural = "Generi"class Libro(models.Model):titolo =
> models.CharField(max_length=200)autore = models.ForeignKey(Autore,
> on_delete=models.CASCADE)genere = models.ForeignKey(Genere,
> on_delete=models.CASCADE)def __str__(self):return
> self.libro_textclass Meta:verbose_name_plural = "Libri"*
>
>
> These are the results
>
>
>
>
> Can someone help me?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c1941b52-7d2b-4b09-8ead-fce630b73757%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAKfjjGrMMEkg85LOVGhDeSes%3D4eMzoh%3DTn%2BwyS%2Bc5VxWMBMiPw%40mail.gmail.com.


Re: Python +django

2019-09-10 Thread Gerardo Palazuelos Guerrero
hi,
Django has been a different beast for me, an .NET programmer...
You need to find your way...

Following are my go-to resources, always:
#1: (free) Djangogirls tutorial
#2: (paid) the books by https://wsvincent.com/books/-- specially that
book (green one) is an excellent resource for beginners
#3: (free to read online) Harry Percival's
https://www.obeythetestinggoat.com/

Note:
I'm not affiliated or anything with those sites... it's just that those
materials are helpful for me and I keep mentioning those to folks

--
Gerardo Palazuelos Guerrero



On Tue, Sep 10, 2019 at 7:25 AM Mario R. Osorio 
wrote:

> I must agree that video tutorials are harder to follow, specially if and
> when they are if at least a bit outdated. I used to hate them however; I've
> learned to appreciate them specially because of one reason: *YOU CANNOT
> COPY AND PASTE.*
>
> Written tutorials don't help you go thru the full learning process and
> make you a master of [Ctrl]-[C] & [Ctrl]-[V] since you're not even checking
> the code nor make sense out of it, let alone memorizing it.
>
> Back in the day, when written tutorials were handed to you on paper,
> probably as photocopy of some else's photocopy (bis), you would learn by
> typing the code yourself. It is online tutorials that I find not as helpful
> anymore.
>
> Now, don't get me wrong, I have found lost of excellent online tutorials.
> The problem is that it is all too easy to copy and paste.
>
> IMHO (and at least in programming) written tutorials are for the very
> first baby steps but once you've outpaced those; you need to move away from
> them, even if we are talking about learning a new programming language,
> tool, framework or paradigm.
>
>
>
> On Monday, September 9, 2019 at 7:59:07 AM UTC-4, ajoeiam wrote:
>>
>> On Mon, Sep 9, 2019 at 6:33 AM selim atmaca  wrote:
>> >
>> > You should learn python basics first but dont dive deep, just the
>> basics. Then
>> > There is a nice django video series on youtube. Search for corey
>> schafer django. There are 17 videos in that series. If I was starting
>> django today, definetly I would start it with that video series.
>> >
>> Hopefully this isn't a thread hijacking - - - - but - - - - -
>> I am finding that online videos are hugely wasteful of time and would
>> rather have a text equivalent.
>> Is there such for this recommended video series?
>>
>> Regards
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/65360234-aaa6-4365-9e8e-fc6d8a3bc5f2%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJ8iCyO7XsMj0JPd8Rj8-PXghPOaxoPnjNELr6e8J73wgvLCpA%40mail.gmail.com.


Re: Dblink creation from Oracle 11g to postgres

2019-09-10 Thread nitin kumar
Sure, for what we are here.
How?

On Tue 10 Sep, 2019, 10:18 PM Peter Mudoko,  wrote:

> Hey I have done one can we discuss about it
>
> On Tue, 10 Sep 2019, 18:12 nitin kumar,  wrote:
>
>> I just want to fetch the data to populate (non editable)in different
>> interface from Oracle 11g to postgresql.
>>
>> How to create the dblink between these two database. What procedure I
>> have to follow?
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/f20f9a61-f6f3-43af-8cde-8024eb55976a%40googlegroups.com
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CABfSCxfenog8PgDVm5%3D_zAupV%2ByLsHkhTbfysJaJcg5JQw3BFA%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACNQfLGRX_aV5eLZXsF4CuDfOrwJRsE7A7%2BuxyRFKbEjVVbyag%40mail.gmail.com.


Re: Dblink creation from Oracle 11g to postgres

2019-09-10 Thread Peter Mudoko
Hey I have done one can we discuss about it

On Tue, 10 Sep 2019, 18:12 nitin kumar,  wrote:

> I just want to fetch the data to populate (non editable)in different
> interface from Oracle 11g to postgresql.
>
> How to create the dblink between these two database. What procedure I have
> to follow?
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f20f9a61-f6f3-43af-8cde-8024eb55976a%40googlegroups.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CABfSCxfenog8PgDVm5%3D_zAupV%2ByLsHkhTbfysJaJcg5JQw3BFA%40mail.gmail.com.


Re: migrate error

2019-09-10 Thread Desh Deepak
Show me your view.py code.

On Tue, 10 Sep 2019, 20:03 Chukwuka,  wrote:

> Might help if you post the migration file 0027.. for testapp
>
> On Mon, Sep 9, 2019 at 9:29 PM Pradeep Singh 
> wrote:
>
>> from django.db import models
>> from django import forms
>> from django.core import validators
>> from django.core.urlresolvers import reverse
>> from django.contrib.auth.models import User
>> from django.db.models.signals import post_save
>> from django.dispatch import receiver
>> from django.utils import timezone
>> from datetime import datetime
>> # Create your models here.
>> class Contact(models.Model):
>>   name = models.CharField(max_length=200)
>>   email = models.CharField(max_length=100)
>>   phone = models.CharField(max_length=100)
>>   message = models.TextField(blank=True)
>>   contact_date = models.DateTimeField(default=datetime.now, blank=True)
>>
>>   def __str__(self):
>> return self.name
>>
>> class Profile(models.Model):
>> user = models.OneToOneField(User, on_delete=models.CASCADE)
>> bio = models.TextField(max_length=500, blank=True)
>> location = models.CharField(max_length=30, blank=True)
>> #sbirth_date = models.DateField(null=True, blank=True)
>>
>> @receiver(post_save, sender=User)
>> def update_user_profile(sender, instance, created, **kwargs):
>> if created:
>> Profile.objects.create(user=instance)
>> instance.profile.save()
>>
>> class Realtor(models.Model):
>>   name = models.CharField(max_length=200)
>>   photo = models.ImageField(upload_to='media/images/')
>>   description = models.TextField(blank=True)
>>   phone = models.CharField(max_length=20)
>>   email = models.CharField(max_length=50)
>>   is_mvp = models.BooleanField(default=False)
>>   hire_date = models.DateTimeField(default=datetime.now, blank=True)
>>   def __str__(self):
>> return self.name
>>
>> PROPERTY_TYPE = (('Select Property Type','Select Property
>> Type'),('Appartment', 'Appartment'),('DDA Appartment', 'DDA Appartment'),
>> ('Builder Floor', 'Builder Floor'), ('Indepedent house', 'Indepedent
>> house'),('Residental Land','Residental Land'))
>> TYPE = (('Select Type','Select Type'),('1 BHK', '1 BHK'), ('2 BHK', '2
>> BHK'), ('3 BHK', '3 BHK'),('4 BHK','4 BHK'),('LAND','Land'),('Janta
>> Flat','Janta Flat'),('LIG Flat','LIG Flat'),('MIG Flat','MIG Flat'),('HIG
>> Flat','HIG Flat'))
>> CITY=(('Select City','Select City'),('West Delhi', 'West Delhi'), ('South
>> Delhi', 'South Delhi'), ('North Delhi', 'North Delhi'),('East Delhi','East
>> Delhi'))
>>
>> class Property(models.Model):
>> realtor= models.ForeignKey(Realtor,  on_delete=models.DO_NOTHING)
>> #image=models.ImageField(upload_to='media/images/',blank=True,
>> null=True)
>> house_name=models.CharField(max_length=30)
>> #PROPERTY_TYPE = (('Select Property Type','Select Property
>> Type'),('Appartment', 'Appartment'),('DDA Appartment', 'DDA Appartment'),
>> ('Builder Floor', 'Builder Floor'), ('Indepedent house', 'Indepedent
>> house'),('Residental Land','Residental Land'))
>> property_type=models.CharField(max_length=20,
>> choices=PROPERTY_TYPE,default='Select Property Type')
>> #TYPE = (('Select Type','Select Type'),('1 BHK', '1 BHK'), ('2 BHK',
>> '2 BHK'), ('3 BHK', '3 BHK'),('4 BHK','4 BHK'),('LAND','Land'),('Janta
>> Flat','Janta Flat'),('LIG Flat','LIG Flat'),('MIG Flat','MIG Flat'),('HIG
>> Flat','HIG Flat'))
>> type=models.CharField(max_length=10,choices=TYPE,default='Select
>> Type')
>> area=models.CharField(max_length=10,blank=False)
>> #CITY=(('Select City','Select City'),('West Delhi', 'West Delhi'),
>> ('South Delhi', 'South Delhi'), ('North Delhi', 'North Delhi'),('East
>> Delhi','East Delhi'))
>> city=models.CharField(max_length=20,choices=CITY,default='Select
>> city')
>> location=models.CharField(max_length=30)
>> price=models.CharField(max_length=20)
>> description=models.TextField(blank=True)
>> publish_date = models.DateTimeField(default=datetime.now, blank=True)
>> publish_date = models.DateTimeField(default=datetime.now, blank=True)
>> image= models.ImageField(upload_to='media/images/',blank=True,
>> null=True )
>> image_1 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> image_2 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> image_3 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> image_4 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> image_5 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> image_6 = models.ImageField(upload_to='media/images/', blank=True ,
>> null=True)
>> #submitted = models.DateField(auto_now_add=True)
>>
>> class Meta:
>> abstract=True
>>
>>
>>
>>
>> class Buy(Property):
>>
>> def __str__(self):
>> return self.house_name
>>
>>
>> class Rent(Property):
>>
>> def __str__(self):
>> return 

Problems with "Class Meta" and " __str__"

2019-09-10 Thread Elmaco7
Hello, I do these models but the Django admin page doesn't read the "class 
Meta" and " __str__".
This is the models.py document





























*from django.db import models# Create your models here.class 
Autore(models.Model):nome = models.CharField(max_length=50)cognome 
= models.CharField(max_length=50)def __str__(self):return 
self.autore_textclass Meta:verbose_name_plural = "Autori"class 
Genere(models.Model):descrizione = models.CharField(max_length=30)def 
__str__(self):return self.genere_textclass Meta:
verbose_name_plural = "Generi"class Libro(models.Model):titolo = 
models.CharField(max_length=200)autore = models.ForeignKey(Autore, 
on_delete=models.CASCADE)genere = models.ForeignKey(Genere, 
on_delete=models.CASCADE)def __str__(self):return 
self.libro_textclass Meta:verbose_name_plural = "Libri"*


These are the results




Can someone help me?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c1941b52-7d2b-4b09-8ead-fce630b73757%40googlegroups.com.


Re: about {% with %}

2019-09-10 Thread Gil Obradors
Hi Mohamed!

It's the open tag for django template language. Very similar to jinja2

https://docs.djangoproject.com/en/2.2/ref/templates/language/

Missatge de mohamed khaled  del dia dt., 10
de set. 2019 a les 17:55:

> what the {% with %}  actually does ???
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/455a8e15-6eb0-46d0-8d00-b0f4ed8dfd7d%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK-JoTT%3DeoqJa%2Bp6XFxB4z07MOjx1%2BPK1WE5nQdO%2BHKNh1B80A%40mail.gmail.com.


about {% with %}

2019-09-10 Thread mohamed khaled
what the {% with %}  actually does ??? 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/455a8e15-6eb0-46d0-8d00-b0f4ed8dfd7d%40googlegroups.com.


Re: Django ORM

2019-09-10 Thread nitin kumar
Not getting you exactly.
Want to populate data based on searching db?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c35cfe2b-2187-463a-bba2-19ee39244456%40googlegroups.com.


Dblink creation from Oracle 11g to postgres

2019-09-10 Thread nitin kumar
I just want to fetch the data to populate (non editable)in different interface 
from Oracle 11g to postgresql.

How to create the dblink between these two database. What procedure I have to 
follow?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f20f9a61-f6f3-43af-8cde-8024eb55976a%40googlegroups.com.


Re: Django 3.0 alpha 1 released

2019-09-10 Thread Benjamin Schollnick
> On Sep 10, 2019, at 5:29 AM, Carlton Gibson  wrote:
> 
> We've made the first release on the way to Django's next major 
> release, Django 3.0! 
> 
> With about two and a half months until the 
> final release (scheduled for December 2nd), we'll need timely testing 
> from the community to ensure an on-time, stable release. 
> 
> Check out the blog post: 
> 
> https://www.djangoproject.com/weblog/2019/sep/10/django-30-alpha-1-released/ 
> 
Looks nice…

1) Is there any plans to officially support MS SQL server directly?  There are 
a few different ways to connect to an MSSQL server, but none of them are very 
well maintained (in a timely manner).   I am currently using 
https://github.com/michiya/django-pyodbc-azure 
, which is forcing me to stay 
at django v2.1.xx, and I’ve used django-mssql in the past (but that hasn’t been 
updated to django v2.xx).   Having an officially supported, and updated ms sql 
bridge would be quite helpful.

2) It’s still early, but how does the performance match up against v2.xx?

- Benjamin


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8B56E6CD-1EFD-457A-B602-7BDF0D0498BF%40schollnick.net.


Re: Postgre sql problem

2019-09-10 Thread Team Infinity
You must have postresql installed so as to install psycopg2 :)

On Saturday, September 7, 2019 at 1:34:31 AM UTC+5:45, Elmaco7 wrote:
>
> *Hello, I'm trying to use Postresql with my django project, but when i try 
> to install psycopg2(with this command 'pip3 install psycopg2')  this 
> problem appears:*
>
> Collecting psycopg2
>   Using cached 
> https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
> Building wheels for collected packages: psycopg2
>   Building wheel for psycopg2 (setup.py) ... error
>   ERROR: Command errored out with exit status 1:
>command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import 
> sys, setuptools, tokenize; sys.argv[0] = 
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; 
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
>  
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
> bdist_wheel -d /tmp/pip-wheel-mkc6kj2i --python-tag cp36
>cwd: /tmp/pip-install-t391_oat/psycopg2/
>   Complete output (40 lines):
>   running bdist_wheel
>   running build
>   running build_py
>   creating build
>   creating build/lib.linux-x86_64-3.6
>   creating build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
>   running build_ext
>   building 'psycopg2._psycopg' extension
>   creating build/temp.linux-x86_64-3.6
>   creating build/temp.linux-x86_64-3.6/psycopg
>   x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g 
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time 
> -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64) 
> -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m 
> -I/home/user/myproject/myprojectenv/include/python3.6m -I. 
> -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c 
> psycopg/psycopgmodule.c -o 
> build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o 
> -Wdeclaration-after-statement
>   In file included from psycopg/psycopgmodule.c:27:0:
>   ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or 
> directory
>#include 
> ^~
>   compilation terminated.
>   
>   It appears you are missing some prerequisite to build the package from 
> source.
>   
>   You may install a binary package by installing 'psycopg2-binary' from 
> PyPI.
>   If you want to install psycopg2 from source, please install the packages
>   required for the build and try again.
>   
>   For further information please check the 'doc/src/install.rst' file 
> (also at
>   ).
>   
>   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>   
>   ERROR: Failed building wheel for psycopg2
>   Running setup.py clean for psycopg2
> Failed to build psycopg2
> Installing collected packages: psycopg2
>   Running setup.py install for psycopg2 ... error
> ERROR: Command errored out with exit status 1:
>  command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import 
> sys, setuptools, tokenize; sys.argv[0] = 
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"'; 
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
>  
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', 
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' 
> install --record /tmp/pip-record-bl1kkv0m/install-record.txt 
> --single-version-externally-managed --compile --install-headers 
> /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
>  cwd: /tmp/pip-install-t391_oat/psycopg2/
> Complete output (40 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-3.6
> creating build/lib.linux-x86_64-3.6/psycopg2
> copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/_lru_cache.py -> 

Re: migrate error

2019-09-10 Thread Chukwuka
Might help if you post the migration file 0027.. for testapp

On Mon, Sep 9, 2019 at 9:29 PM Pradeep Singh  wrote:

> from django.db import models
> from django import forms
> from django.core import validators
> from django.core.urlresolvers import reverse
> from django.contrib.auth.models import User
> from django.db.models.signals import post_save
> from django.dispatch import receiver
> from django.utils import timezone
> from datetime import datetime
> # Create your models here.
> class Contact(models.Model):
>   name = models.CharField(max_length=200)
>   email = models.CharField(max_length=100)
>   phone = models.CharField(max_length=100)
>   message = models.TextField(blank=True)
>   contact_date = models.DateTimeField(default=datetime.now, blank=True)
>
>   def __str__(self):
> return self.name
>
> class Profile(models.Model):
> user = models.OneToOneField(User, on_delete=models.CASCADE)
> bio = models.TextField(max_length=500, blank=True)
> location = models.CharField(max_length=30, blank=True)
> #sbirth_date = models.DateField(null=True, blank=True)
>
> @receiver(post_save, sender=User)
> def update_user_profile(sender, instance, created, **kwargs):
> if created:
> Profile.objects.create(user=instance)
> instance.profile.save()
>
> class Realtor(models.Model):
>   name = models.CharField(max_length=200)
>   photo = models.ImageField(upload_to='media/images/')
>   description = models.TextField(blank=True)
>   phone = models.CharField(max_length=20)
>   email = models.CharField(max_length=50)
>   is_mvp = models.BooleanField(default=False)
>   hire_date = models.DateTimeField(default=datetime.now, blank=True)
>   def __str__(self):
> return self.name
>
> PROPERTY_TYPE = (('Select Property Type','Select Property
> Type'),('Appartment', 'Appartment'),('DDA Appartment', 'DDA Appartment'),
> ('Builder Floor', 'Builder Floor'), ('Indepedent house', 'Indepedent
> house'),('Residental Land','Residental Land'))
> TYPE = (('Select Type','Select Type'),('1 BHK', '1 BHK'), ('2 BHK', '2
> BHK'), ('3 BHK', '3 BHK'),('4 BHK','4 BHK'),('LAND','Land'),('Janta
> Flat','Janta Flat'),('LIG Flat','LIG Flat'),('MIG Flat','MIG Flat'),('HIG
> Flat','HIG Flat'))
> CITY=(('Select City','Select City'),('West Delhi', 'West Delhi'), ('South
> Delhi', 'South Delhi'), ('North Delhi', 'North Delhi'),('East Delhi','East
> Delhi'))
>
> class Property(models.Model):
> realtor= models.ForeignKey(Realtor,  on_delete=models.DO_NOTHING)
> #image=models.ImageField(upload_to='media/images/',blank=True,
> null=True)
> house_name=models.CharField(max_length=30)
> #PROPERTY_TYPE = (('Select Property Type','Select Property
> Type'),('Appartment', 'Appartment'),('DDA Appartment', 'DDA Appartment'),
> ('Builder Floor', 'Builder Floor'), ('Indepedent house', 'Indepedent
> house'),('Residental Land','Residental Land'))
> property_type=models.CharField(max_length=20,
> choices=PROPERTY_TYPE,default='Select Property Type')
> #TYPE = (('Select Type','Select Type'),('1 BHK', '1 BHK'), ('2 BHK',
> '2 BHK'), ('3 BHK', '3 BHK'),('4 BHK','4 BHK'),('LAND','Land'),('Janta
> Flat','Janta Flat'),('LIG Flat','LIG Flat'),('MIG Flat','MIG Flat'),('HIG
> Flat','HIG Flat'))
> type=models.CharField(max_length=10,choices=TYPE,default='Select Type')
> area=models.CharField(max_length=10,blank=False)
> #CITY=(('Select City','Select City'),('West Delhi', 'West Delhi'),
> ('South Delhi', 'South Delhi'), ('North Delhi', 'North Delhi'),('East
> Delhi','East Delhi'))
> city=models.CharField(max_length=20,choices=CITY,default='Select city')
> location=models.CharField(max_length=30)
> price=models.CharField(max_length=20)
> description=models.TextField(blank=True)
> publish_date = models.DateTimeField(default=datetime.now, blank=True)
> publish_date = models.DateTimeField(default=datetime.now, blank=True)
> image= models.ImageField(upload_to='media/images/',blank=True,
> null=True )
> image_1 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> image_2 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> image_3 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> image_4 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> image_5 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> image_6 = models.ImageField(upload_to='media/images/', blank=True ,
> null=True)
> #submitted = models.DateField(auto_now_add=True)
>
> class Meta:
> abstract=True
>
>
>
>
> class Buy(Property):
>
> def __str__(self):
> return self.house_name
>
>
> class Rent(Property):
>
> def __str__(self):
> return self.house_name
>
> class PG(Property):
> def __str__(self):
> return self.house_name
>
>
> YOU_ARE=(('Select','Select'),('Owner', 'Owner'), ('Dealer', 'Dealer'),
> ('Agent', 'Agent'))
> 

Re: Django 3.0 alpha 1 released

2019-09-10 Thread Benjamin Schollnick
We've made the first release on the way to Django's next major 

> release, Django 3.0! 
>
> With about two and a half months until the 
> final release (scheduled for December 2nd), we'll need timely testing 
> from the community to ensure an on-time, stable release. 
>
> Check out the blog post: 
>
>
> https://www.djangoproject.com/weblog/2019/sep/10/django-30-alpha-1-released/


The updates look nice...

1) Is there any plans to officially support MS SQL server directly?
   There are a few different ways to connect to an MSSQL server, but none
   of them are very well maintained (in a timely manner).   I am currently
   using https://github.com/michiya/django-pyodbc-azure
   , which is forcing me to
   stay at django v2.1.xx, and I've used django-mssql in the past
   (but that hasn't been updated to django v2.xx).   Having an
   officially supported, and updated ms sql bridge would be quite helpful.

2) Its still early, but how does the performance match up against v2.xx?

- Benjamin 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9f404ffe-b272-4944-8e98-80e8f9e5ad4a%40googlegroups.com.


Re: Python +django

2019-09-10 Thread Mario R. Osorio
I must agree that video tutorials are harder to follow, specially if and 
when they are if at least a bit outdated. I used to hate them however; I've 
learned to appreciate them specially because of one reason: *YOU CANNOT 
COPY AND PASTE.*

Written tutorials don't help you go thru the full learning process and make 
you a master of [Ctrl]-[C] & [Ctrl]-[V] since you're not even checking the 
code nor make sense out of it, let alone memorizing it.

Back in the day, when written tutorials were handed to you on paper, 
probably as photocopy of some else's photocopy (bis), you would learn by 
typing the code yourself. It is online tutorials that I find not as helpful 
anymore.

Now, don't get me wrong, I have found lost of excellent online tutorials. 
The problem is that it is all too easy to copy and paste.

IMHO (and at least in programming) written tutorials are for the very first 
baby steps but once you've outpaced those; you need to move away from them, 
even if we are talking about learning a new programming language, tool, 
framework or paradigm.



On Monday, September 9, 2019 at 7:59:07 AM UTC-4, ajoeiam wrote:
>
> On Mon, Sep 9, 2019 at 6:33 AM selim atmaca  > wrote: 
> > 
> > You should learn python basics first but dont dive deep, just the 
> basics. Then 
> > There is a nice django video series on youtube. Search for corey schafer 
> django. There are 17 videos in that series. If I was starting django today, 
> definetly I would start it with that video series. 
> > 
> Hopefully this isn't a thread hijacking - - - - but - - - - - 
> I am finding that online videos are hugely wasteful of time and would 
> rather have a text equivalent. 
> Is there such for this recommended video series? 
>
> Regards 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/65360234-aaa6-4365-9e8e-fc6d8a3bc5f2%40googlegroups.com.


Re: Django 3.0 alpha 1 released

2019-09-10 Thread Brian M
On Tue, Sep 10, 2019, 5:30 AM Carlton Gibson 
wrote:

> We've made the first release on the way to Django's next major
> release, Django 3.0!
>
> With about two and a half months until the
> final release (scheduled for December 2nd), we'll need timely testing
> from the community to ensure an on-time, stable release.
>
> Check out the blog post:
>
>
> https://www.djangoproject.com/weblog/2019/sep/10/django-30-alpha-1-released/
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/61CB562A-644C-41D7-92AD-0698400FEBE2%40gmail.com
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAPHjX8EHxv%3DtCsZ_%3DKiUSiUzLzwXMRE-jtSS-unQeYtFTUe%3DGw%40mail.gmail.com.


Re: need permissions for post method

2019-09-10 Thread Micheal Desousa
dei
Thanks,
with regrads
Micheal.


On Tue, Sep 10, 2019 at 5:20 PM siva.gatti  wrote:

> Hi,
>
> class UserViewSet(viewsets.ModelViewSet):
> permission_classes = [IsAuthenticated]
> queryset = Documents.objects.all()
> serializer_class = DocumentSerializer
>
> this is my viewset. I want to allow users for post method without
> authentication how can i add allowed methods here.with authentication and
> without authentication
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/293a9666-5b87-402f-bb64-0c215483a67a%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJvpbUFi4nrjmfefi2taG_E4PAoKRNbcZaV4HqFL036%2BN8jbUQ%40mail.gmail.com.


need permissions for post method

2019-09-10 Thread siva.gatti
Hi,

class UserViewSet(viewsets.ModelViewSet):
permission_classes = [IsAuthenticated]
queryset = Documents.objects.all()
serializer_class = DocumentSerializer

this is my viewset. I want to allow users for post method without 
authentication how can i add allowed methods here.with authentication and 
without authentication

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/293a9666-5b87-402f-bb64-0c215483a67a%40googlegroups.com.


Re: Relation between different database?

2019-09-10 Thread Jason
https://docs.djangoproject.com/en/2.2/topics/db/multi-db/

If you have to do this, Django does support multiple databases. But you’re 
going to need to handle the data consistency and integrity you’r.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a4b77e83-63c4-430f-b311-a7c7fad6d5db%40googlegroups.com.


Django 3.0 alpha 1 released

2019-09-10 Thread Carlton Gibson
We've made the first release on the way to Django's next major 
release, Django 3.0! 

With about two and a half months until the 
final release (scheduled for December 2nd), we'll need timely testing 
from the community to ensure an on-time, stable release. 

Check out the blog post: 

https://www.djangoproject.com/weblog/2019/sep/10/django-30-alpha-1-released/

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/61CB562A-644C-41D7-92AD-0698400FEBE2%40gmail.com.


Re: Meta question

2019-09-10 Thread ANi
getattr(instance, key) to get the value 
setattr(instance, key ,value) to put the value, and remember to do 
instance.save() otherwise it won't actually be changed.
 
Mike Dewhirst於 2019年9月10日星期二 UTC+8下午4時27分06秒寫道:
>
> Given a model instance and the name of one of its fields as a string, 
> how can I get/put a value in that field? 
>
> The methods might look like this ... 
>
> def get_value(obj, fldname): 
>
>  ... 
>
>  return value 
>
> def put_value(obj, fldname, value): 
>
>  pass 
>
>
> Thanks for any hints 
>
> Mike 
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/abe0c993-6cf5-4a55-9d3b-9dd213cad8db%40googlegroups.com.


Re: migrate error

2019-09-10 Thread Rahul Roshan
First you can cleanup all migrations files in /migrations/*. And then try
to provide *default=" " *for contact_no. Try to migrate all these changes !

On Tue, Sep 10, 2019 at 1:42 PM Pradeep Singh  wrote:

> okay . yes i did but problem are same
>
> On Tue, 10 Sep 2019 at 12:49, Rahul Roshan 
> wrote:
>
>> Can you try contact_date default=" " !
>>
>> On Tue, Sep 10, 2019, 12:22 PM ANi  wrote:
>>
>>>
>>>  Another piece of advice, please prettify your code or take a screenshot
>>> , not just paste it directly.
>>>  It is not easy to read to you as well, right?
>>>
>>>
>>>
>>> what had you done in this migration?
>>> Was the original value in that column a datetime and you want to change
>>> it into another data format?
>>>
>>>
>>> Pradeep Singh於 2019年9月10日星期二 UTC+8上午10時44分28秒寫道:

  I didnot get why i am getting this error .please help to fix it

>>> --
>>> 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 view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/8540486f-2bbf-4f39-aa81-82e26cfb352c%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/CAN%2BO0S4yH%3DoiU5hYfKQK2T-1nSAFF3djqECKADeAXRgf-mPDWw%40mail.gmail.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CANwgZcaVsdbUFagqLC-is802jjvLM91SGiZ270Y2sRNXkSNx5A%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN%2BO0S6UqD99%3D33qJtjj8CNCJo1fRrWJuciYthToUhSUY7g5TQ%40mail.gmail.com.


Meta question

2019-09-10 Thread Mike Dewhirst
Given a model instance and the name of one of its fields as a string, 
how can I get/put a value in that field?


The methods might look like this ...

def get_value(obj, fldname):

    ...

    return value

def put_value(obj, fldname, value):

    pass


Thanks for any hints

Mike


--
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/514e1115-36b6-2e5f-f07e-68386927a1f1%40dewhirst.com.au.


Re: migrate error

2019-09-10 Thread Pradeep Singh
okay . yes i did but problem are same

On Tue, 10 Sep 2019 at 12:49, Rahul Roshan  wrote:

> Can you try contact_date default=" " !
>
> On Tue, Sep 10, 2019, 12:22 PM ANi  wrote:
>
>>
>>  Another piece of advice, please prettify your code or take a screenshot,
>> not just paste it directly.
>>  It is not easy to read to you as well, right?
>>
>>
>>
>> what had you done in this migration?
>> Was the original value in that column a datetime and you want to change
>> it into another data format?
>>
>>
>> Pradeep Singh於 2019年9月10日星期二 UTC+8上午10時44分28秒寫道:
>>>
>>>  I didnot get why i am getting this error .please help to fix it
>>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/8540486f-2bbf-4f39-aa81-82e26cfb352c%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAN%2BO0S4yH%3DoiU5hYfKQK2T-1nSAFF3djqECKADeAXRgf-mPDWw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CANwgZcaVsdbUFagqLC-is802jjvLM91SGiZ270Y2sRNXkSNx5A%40mail.gmail.com.


Re: migrate error

2019-09-10 Thread Rahul Roshan
Can you try contact_date default=" " !

On Tue, Sep 10, 2019, 12:22 PM ANi  wrote:

>
>  Another piece of advice, please prettify your code or take a screenshot,
> not just paste it directly.
>  It is not easy to read to you as well, right?
>
>
>
> what had you done in this migration?
> Was the original value in that column a datetime and you want to change it
> into another data format?
>
>
> Pradeep Singh於 2019年9月10日星期二 UTC+8上午10時44分28秒寫道:
>>
>>  I didnot get why i am getting this error .please help to fix it
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8540486f-2bbf-4f39-aa81-82e26cfb352c%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAN%2BO0S4yH%3DoiU5hYfKQK2T-1nSAFF3djqECKADeAXRgf-mPDWw%40mail.gmail.com.


Re: migrate error

2019-09-10 Thread ANi

 Another piece of advice, please prettify your code or take a screenshot, 
not just paste it directly.
 It is not easy to read to you as well, right?



what had you done in this migration?
Was the original value in that column a datetime and you want to change it 
into another data format?


Pradeep Singh於 2019年9月10日星期二 UTC+8上午10時44分28秒寫道:
>
>  I didnot get why i am getting this error .please help to fix it 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8540486f-2bbf-4f39-aa81-82e26cfb352c%40googlegroups.com.


Re: 404 error

2019-09-10 Thread ANi
The fastest way to know why is to read your error messages.

 

arpit Dubey於 2019年9月7日星期六 UTC+8下午11時38分38秒寫道:
>
> I have followed all the steps for creating our first app  polls but it is 
> showing the error of 404 
> could you please help me to finding it out why it is happening there after 
> copying each and every step from documentation.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/817bded2-a28f-456c-87d3-67d679eba312%40googlegroups.com.


Re: Relation between different database?

2019-09-10 Thread ANi
the key point is about the relation in* different databases*,
if it is possible to have relations, then I don't need to write additional 
code to access data from the remote one.


ANi於 2019年9月10日星期二 UTC+8上午11時54分28秒寫道:
>
> Hi, 
>
> I have my asset table in local db which need to reference to the employee 
> view from another database. 
> But I realized that Django might not allow relations across databases, 
> right?
>
> so does it means that I can only store the employee key as string in the 
> asset table?
> or other way to achieve?
>
> many thanks,
> ANi
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/fd08e15f-c868-478c-a82d-542867364121%40googlegroups.com.


Re: Query into Django ORM

2019-09-10 Thread Ronit Mishra
Hi Amit,

Excuse me for my straight forwardness, but this not a challenge. From what
I can see is, you want someone to write you the complete code for your
models.

You didn't even write a single line of code, and you're expecting someone
to write the whole damn thing for you. Unless you're willing to pay for
this, I for sure wont help you.

Take this email as constructive criticism, and either start working on your
own or hire someone. Don't spam my inbox.

Regards,
Ronnie

On Tue, Sep 10, 2019 at 11:31 AM N'BE SORO  wrote:

> Hello please send your models example and.
>
> Le jeu. 5 sept. 2019 à 14:56, Amit Samanta  a
> écrit :
>
>> Hi,
>>
>> I am facing a challenge please help me.
>>
>> [image: Query.PNG]
>>
>>
>> output:
>>
>> [image: output.PNG]
>>
>> Here one env_name can have many comp name and one env with one comp_name
>> there will be many deploy_details which is in green colour (latest).
>>
>> in deploy_detail if there is two deploy in one component we will take the
>> latest deploy_date.
>>
>>
>> Now please can anyone help me in converting this query into Django ORM
>> and the models
>>
>> Thanks in advance
>>
>>
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/db10af4c-ef4c-47cb-82fd-a442d3b381ab%40googlegroups.com
>> 
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAOtSHp_5uVs1zmqDz%3DXNb%3DZJmB_yvL%3DNqBt0WPtDL0nbsez0yw%40mail.gmail.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACh0Ehwf70Ym%3DE9hUs%3Dw7LsAT6JKHZo%3DpK9mdZHYYKT7hztUmQ%40mail.gmail.com.


Re: Relation between different database?

2019-09-10 Thread N'BE SORO
Ok you can add an additional column my_id and you give him the unique
property = True

Le mar. 10 sept. 2019 à 06:00, ANi  a écrit :

> my real situation as an example.
>
> *local database*
> AssetModel(id, employee, name, barcode, location, value)
>
> *remote database*
> EmployeeView(id, name, department)
>
> I am thinking to set employee in AssetModel as an ForeignKey which
> references to EmployeeView.
> but it seems to be not allowed
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/4617ae94-1cf1-42be-8441-2ba84e9d04ef%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOtSHp9trTFp8ksbv2Y_TYeTHZp0gvi%3DaakN5GhgpEhBEXJPxA%40mail.gmail.com.


Re: Query into Django ORM

2019-09-10 Thread N'BE SORO
Hello please send your models example and.

Le jeu. 5 sept. 2019 à 14:56, Amit Samanta  a
écrit :

> Hi,
>
> I am facing a challenge please help me.
>
> [image: Query.PNG]
>
>
> output:
>
> [image: output.PNG]
>
> Here one env_name can have many comp name and one env with one comp_name
> there will be many deploy_details which is in green colour (latest).
>
> in deploy_detail if there is two deploy in one component we will take the
> latest deploy_date.
>
>
> Now please can anyone help me in converting this query into Django ORM and
> the models
>
> Thanks in advance
>
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/db10af4c-ef4c-47cb-82fd-a442d3b381ab%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAOtSHp_5uVs1zmqDz%3DXNb%3DZJmB_yvL%3DNqBt0WPtDL0nbsez0yw%40mail.gmail.com.


Re: Postgre sql problem

2019-09-10 Thread N'BE SORO
Hello.
Install *psycopg2 binary version*

Le ven. 6 sept. 2019 à 22:06, Thomas Lockhart  a
écrit :

> You need the python-devel package installed for the version of python you
> are running.
>
> - Tom
>
> On Sep 6, 2019, at 12:49 PM, Elmaco7  wrote:
>
> *Hello, I'm trying to use Postresql with my django project, but when i try
> to install psycopg2(with this command 'pip3 install psycopg2')  this
> problem appears:*
>
> Collecting psycopg2
>   Using cached
> https://files.pythonhosted.org/packages/5c/1c/6997288da181277a0c29bc39a5f9143ff20b8c99f2a7d059cfb55163e165/psycopg2-2.8.3.tar.gz
> Building wheels for collected packages: psycopg2
>   Building wheel for psycopg2 (setup.py) ... error
>   ERROR: Command errored out with exit status 1:
>command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
> sys, setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> bdist_wheel -d /tmp/pip-wheel-mkc6kj2i --python-tag cp36
>cwd: /tmp/pip-install-t391_oat/psycopg2/
>   Complete output (40 lines):
>   running bdist_wheel
>   running build
>   running build_py
>   creating build
>   creating build/lib.linux-x86_64-3.6
>   creating build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_range.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_lru_cache.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/sql.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extensions.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_ipaddress.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errorcodes.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/tz.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/extras.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/_json.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/errors.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/compat.py -> build/lib.linux-x86_64-3.6/psycopg2
>   copying lib/__init__.py -> build/lib.linux-x86_64-3.6/psycopg2
>   running build_ext
>   building 'psycopg2._psycopg' extension
>   creating build/temp.linux-x86_64-3.6
>   creating build/temp.linux-x86_64-3.6/psycopg
>   x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g
> -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
> -D_FORTIFY_SOURCE=2 -fPIC -DPSYCOPG_VERSION=2.8.3 (dt dec pq3 ext lo64)
> -DPG_VERSION_NUM=100010 -DHAVE_LO64=1 -I/usr/include/python3.6m
> -I/home/user/myproject/myprojectenv/include/python3.6m -I.
> -I/usr/include/postgresql -I/usr/include/postgresql/10/server -c
> psycopg/psycopgmodule.c -o
> build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o
> -Wdeclaration-after-statement
>   In file included from psycopg/psycopgmodule.c:27:0:
>   ./psycopg/psycopg.h:34:10: fatal error: Python.h: No such file or
> directory
>#include 
> ^~
>   compilation terminated.
>
>   It appears you are missing some prerequisite to build the package from
> source.
>
>   You may install a binary package by installing 'psycopg2-binary' from
> PyPI.
>   If you want to install psycopg2 from source, please install the packages
>   required for the build and try again.
>
>   For further information please check the 'doc/src/install.rst' file
> (also at
>   ).
>
>   error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
>   
>   ERROR: Failed building wheel for psycopg2
>   Running setup.py clean for psycopg2
> Failed to build psycopg2
> Installing collected packages: psycopg2
>   Running setup.py install for psycopg2 ... error
> ERROR: Command errored out with exit status 1:
>  command: /home/user/myproject/myprojectenv/bin/python3 -u -c 'import
> sys, setuptools, tokenize; sys.argv[0] =
> '"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';
> __file__='"'"'/tmp/pip-install-t391_oat/psycopg2/setup.py'"'"';f=getattr(tokenize,
> '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"',
> '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))'
> install --record /tmp/pip-record-bl1kkv0m/install-record.txt
> --single-version-externally-managed --compile --install-headers
> /home/user/myproject/myprojectenv/include/site/python3.6/psycopg2
>  cwd: /tmp/pip-install-t391_oat/psycopg2/
> Complete output (40 lines):
> running install
> running build
> running build_py
> creating build
> creating build/lib.linux-x86_64-3.6
> creating build/lib.linux-x86_64-3.6/psycopg2
> copying lib/pool.py -> build/lib.linux-x86_64-3.6/psycopg2
> copying lib/_range.py -> 

Re: Relation between different database?

2019-09-10 Thread ANi
my real situation as an example.

*local database*
AssetModel(id, employee, name, barcode, location, value)

*remote database*
EmployeeView(id, name, department)

I am thinking to set employee in AssetModel as an ForeignKey which 
references to EmployeeView.
but it seems to be not allowed


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/4617ae94-1cf1-42be-8441-2ba84e9d04ef%40googlegroups.com.