Set different value for a field when Admin creates an user

2019-11-29 Thread Fruity Code
I have an updated user model and added two fields to it, mobile_number and 
role. The field role has two options Customer and Admin. Currently, I have 
made customer as the default value for role. Now what I want is when user 
signup the role should be a customer but when an admin create a user from 
Django admin it's role should be Admin.

-- 
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/02a95589-3cae-4731-9a1a-66872d630e68%40googlegroups.com.


core hrms software - online hrm software - cloud hr software

2019-11-29 Thread WINHRMPAYROLL CLOUD HRM PAYROLL SOFTWARE
Cloud-based core HRMS Software 
-Try our Cloud HRMS 
software from Win HRM Payroll. Operate Hassle-Free HRMS Software with our 
Cloud Based best HRM Software. Manage complete Humana resource Management 
Functions with our cloud HRMS software solution. Win HRM Payroll cloud HRMS 
software for small businesses. and midsize businesses

-- 
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/f7b63d37-73c9-44b3-b0d9-e2b429473905%40googlegroups.com.


HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread EMPOWER EXCEL
cqn some body helps me to correct this error while running *python 
manager.py runeserver *
(analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$ 
python manage.py runserver
Performing system checks...
System check identified no issues (0 silenced).
Unhandled exception in thread started by 
Traceback (most recent call last):
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
 
line 228, in wrapper
fn(*args, **kwargs)
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
 
line 127, in inner_run
self.check_migrations()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
 
line 422, in check_migrations
executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
 
line 20, in __init__
self.loader = MigrationLoader(self.connection)
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
 
line 52, in __init__
self.build_graph()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
 
line 210, in build_graph
self.applied_migrations = recorder.applied_migrations()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
 
line 65, in applied_migrations
self.ensure_schema()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
 
line 52, in ensure_schema
if self.Migration._meta.db_table in 
self.connection.introspection.table_names(self.connection.cursor()):
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 254, in cursor
return self._cursor()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 229, in _cursor
self.ensure_connection()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 213, in ensure_connection
self.connect()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
 
line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 213, in ensure_connection
self.connect()
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
 
line 189, in connect
self.connection = self.get_new_connection(conn_params)
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
 
line 176, in get_new_connection
connection = Database.connect(**conn_params)
  File 
"/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
 
line 126, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
django.db.utils.OperationalError: FATAL:  password authentication failed 
for user "postgres"
FATAL:  password authentication failed for user "postgres"

-- 
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/eb5beb47-013e-4e07-a077-31a732635325%40googlegroups.com.


Update _id field before .save() for ForeignKey

2019-11-29 Thread Maxim Bulatov
Hello,

I have lot of lists like follow:
(Name1): (V1, V2, V3, V4, ..)

And I use many threads to create many db objects:
company = Company(Name)
for x in vector:
v = CompanyValue(company=company, value=x)
values.append(v)

class CompanyValue(models.Model):
company = models.ForeignKey('Company', on_delete=models.CASCADE)
value = FloatField

This pool of threads return all lists, what I combine, filter and want put 
to database in one bulk_create call.
Suddenly, I found, company.id is not ready to be linked in CompanyValue, 
follow code does not works:
Company.objects.bulk_create(companies)
CompanyValue.objects.bulk_create(values)  # value.company_id is null 
here

No way to save objects in my threads, because I need to filter objects and 
can do it only when all of them are collected. Also, it has performance 
issues 100k+ of requests is slowly enough. I have two ways to resolve:
1. I can make intermediate class or tuple and create CompanyValue objects 
only when companies is saved to db. Hard to support, hard to filter, not so 
clean.
2. I can use dirty hack to update _id field:
for v in values:
v.company = v.company

Can you advice more ways for me? It seems, I don't know something from 
django features to make it elegant.
I see 11 years old issue here (https://code.djangoproject.com/ticket/9553 
) and it marked as intended 
behaviour.

-- 
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/3d62beaf-7fbf-492f-b998-1539f45cd7a0%40googlegroups.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread Integr@te System
Hi freind,

check your connection on vm first, and then config
https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-HOST

On Fri, Nov 29, 2019, 19:41 EMPOWER EXCEL  wrote:

> cqn some body helps me to correct this error while running *python
> manager.py runeserver *
> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$
> python manage.py runserver
> Performing system checks...
> System check identified no issues (0 silenced).
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
> line 228, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
> line 127, in inner_run
> self.check_migrations()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 422, in check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
> line 20, in __init__
> self.loader = MigrationLoader(self.connection)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 52, in __init__
> self.build_graph()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 210, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 65, in applied_migrations
> self.ensure_schema()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 52, in ensure_schema
> if self.Migration._meta.db_table in
> self.connection.introspection.table_names(self.connection.cursor()):
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 254, in cursor
> return self._cursor()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 229, in _cursor
> self.ensure_connection()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 213, in ensure_connection
> self.connect()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
> line 94, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 213, in ensure_connection
> self.connect()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 189, in connect
> self.connection = self.get_new_connection(conn_params)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
> line 176, in get_new_connection
> connection = Database.connect(**conn_params)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
> line 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: FATAL:  password authentication failed
> for user "postgres"
> FATAL:  password authentication failed for user "postgres"
>
> --
> 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/eb5beb47-013e-4e07-a077-31a732635325%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/CAP5HUWoH9Hx6BdN-MY_mwadT31jDKBoO46H2%3DqAo4KuFShRN1w%40mail.gmail.com.


Re: Set different value for a field when Admin creates an user

2019-11-29 Thread Sencer Hamarat
Check request.user.is_superuser. If it return True, the role of the user
signed in is Admin.

Saygılarımla,
Sencer HAMARAT



On Fri, Nov 29, 2019 at 3:41 PM Fruity Code  wrote:

> I have an updated user model and added two fields to it, mobile_number and
> role. The field role has two options Customer and Admin. Currently, I have
> made customer as the default value for role. Now what I want is when user
> signup the role should be a customer but when an admin create a user from
> Django admin it's role should be Admin.
>
> --
> 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/02a95589-3cae-4731-9a1a-66872d630e68%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/CACp8TZgi%3D4nG%2BazKGK3JXBRBkD0XuhFuWsNzQWdRxJ9TcQgV5w%40mail.gmail.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread EMPOWER EXCEL
thanks

On 11/29/19, Integr@te System  wrote:
> Hi freind,
>
> check your connection on vm first, and then config
> https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-HOST
>
> On Fri, Nov 29, 2019, 19:41 EMPOWER EXCEL  wrote:
>
>> cqn some body helps me to correct this error while running *python
>> manager.py runeserver *
>> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$
>> python manage.py runserver
>> Performing system checks...
>> System check identified no issues (0 silenced).
>> Unhandled exception in thread started by 
>> Traceback (most recent call last):
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
>> line 228, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
>> line 127, in inner_run
>> self.check_migrations()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
>> line 422, in check_migrations
>> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
>> line 20, in __init__
>> self.loader = MigrationLoader(self.connection)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>> line 52, in __init__
>> self.build_graph()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>> line 210, in build_graph
>> self.applied_migrations = recorder.applied_migrations()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>> line 65, in applied_migrations
>> self.ensure_schema()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>> line 52, in ensure_schema
>> if self.Migration._meta.db_table in
>> self.connection.introspection.table_names(self.connection.cursor()):
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 254, in cursor
>> return self._cursor()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 229, in _cursor
>> self.ensure_connection()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 213, in ensure_connection
>> self.connect()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 94, in __exit__
>> six.reraise(dj_exc_type, dj_exc_value, traceback)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 213, in ensure_connection
>> self.connect()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 189, in connect
>> self.connection = self.get_new_connection(conn_params)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
>> line 176, in get_new_connection
>> connection = Database.connect(**conn_params)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
>> line 126, in connect
>> conn = _connect(dsn, connection_factory=connection_factory,
>> **kwasync)
>> django.db.utils.OperationalError: FATAL:  password authentication failed
>> for user "postgres"
>> FATAL:  password authentication failed for user "postgres"
>>
>> --
>> 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/eb5beb47-013e-4e07-a077-31a732635325%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/CAP5HUWoH9Hx6BdN-MY_mwadT31jDKBoO46H2%3DqAo4KuFShRN1w%40mail.gmail.com.
>


-- 
FLAVIEN HERI

*Information management AscociateUNHCR-Kinshasa*
Tél:+24397858

Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Integr@te System
Hi guy,

I see this doc fix for u, with builtin pk in models django.
And you can create index in text/char field to optimize performance.

https://docs.djangoproject.com/en/dev/ref/databases/#manually-specified-autoincrement-pk


On Fri, Nov 29, 2019, 19:41 Maxim Bulatov  wrote:

> Hello,
>
> I have lot of lists like follow:
> (Name1): (V1, V2, V3, V4, ..)
>
> And I use many threads to create many db objects:
> company = Company(Name)
> for x in vector:
> v = CompanyValue(company=company, value=x)
> values.append(v)
>
> class CompanyValue(models.Model):
> company = models.ForeignKey('Company', on_delete=models.CASCADE)
> value = FloatField
>
> This pool of threads return all lists, what I combine, filter and want put
> to database in one bulk_create call.
> Suddenly, I found, company.id is not ready to be linked in CompanyValue,
> follow code does not works:
> Company.objects.bulk_create(companies)
> CompanyValue.objects.bulk_create(values)  # value.company_id is null
> here
>
> No way to save objects in my threads, because I need to filter objects and
> can do it only when all of them are collected. Also, it has performance
> issues 100k+ of requests is slowly enough. I have two ways to resolve:
> 1. I can make intermediate class or tuple and create CompanyValue objects
> only when companies is saved to db. Hard to support, hard to filter, not so
> clean.
> 2. I can use dirty hack to update _id field:
> for v in values:
> v.company = v.company
>
> Can you advice more ways for me? It seems, I don't know something from
> django features to make it elegant.
> I see 11 years old issue here (https://code.djangoproject.com/ticket/9553
> ) and it marked as
> intended behaviour.
>
> --
> 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/3d62beaf-7fbf-492f-b998-1539f45cd7a0%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/CAP5HUWrC747ZHLWPCf7UK%2BZvZRDAcxDMxk7ewE4d4UhZAHpB7g%40mail.gmail.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread John McClain
try resetting the PW

On Fri, 29 Nov 2019 at 12:40, EMPOWER EXCEL  wrote:

> cqn some body helps me to correct this error while running *python
> manager.py runeserver *
> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$
> python manage.py runserver
> Performing system checks...
> System check identified no issues (0 silenced).
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
> line 228, in wrapper
> fn(*args, **kwargs)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
> line 127, in inner_run
> self.check_migrations()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
> line 422, in check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
> line 20, in __init__
> self.loader = MigrationLoader(self.connection)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 52, in __init__
> self.build_graph()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
> line 210, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 65, in applied_migrations
> self.ensure_schema()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
> line 52, in ensure_schema
> if self.Migration._meta.db_table in
> self.connection.introspection.table_names(self.connection.cursor()):
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 254, in cursor
> return self._cursor()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 229, in _cursor
> self.ensure_connection()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 213, in ensure_connection
> self.connect()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
> line 94, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 213, in ensure_connection
> self.connect()
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
> line 189, in connect
> self.connection = self.get_new_connection(conn_params)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
> line 176, in get_new_connection
> connection = Database.connect(**conn_params)
>   File
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
> line 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: FATAL:  password authentication failed
> for user "postgres"
> FATAL:  password authentication failed for user "postgres"
>
> --
> 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/eb5beb47-013e-4e07-a077-31a732635325%40googlegroups.com
> 
> .
>


-- 
John McClain

Cell: 085-1977-823
Skype: jmcclain0129
Email: jmcclain0...@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-hv_rehht5z8UWUpu_4KTGkCBHnktrpopk53agYhSSuxGoQQ%40mail.gmail.com.


Django Africa

2019-11-29 Thread Joshua Kayode
Are you Interested in seeing more people across Africa tap into the
potential of the web? and would like to help reached
underserved communities?
Then join DjangoAfrica with the mission to spread the knowledge of the web
across underserved communities. Join our WhatsApp group
*https://chat.whatsapp.com/F36wdJLePsx9vhDsCP5fYA
*

Check out our website *djangoafrica.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/CAEL9fCGfN9bfRXhC-yiHPjrzizOvbNFF-hQr2yKg58OAB9dD2Q%40mail.gmail.com.


Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Dvenum
Integr@te System, thanks. If I set pk (id) manually, it works, but hard to
specify this id value. Maybe for one thread this way is good.

On Fri, Nov 29, 2019 at 10:59 PM Integr@te System 
wrote:

> Hi guy,
>
> I see this doc fix for u, with builtin pk in models django.
> And you can create index in text/char field to optimize performance.
>
>
> https://docs.djangoproject.com/en/dev/ref/databases/#manually-specified-autoincrement-pk
>
>
> On Fri, Nov 29, 2019, 19:41 Maxim Bulatov  wrote:
>
>> Hello,
>>
>> I have lot of lists like follow:
>> (Name1): (V1, V2, V3, V4, ..)
>>
>> And I use many threads to create many db objects:
>> company = Company(Name)
>> for x in vector:
>> v = CompanyValue(company=company, value=x)
>> values.append(v)
>>
>> class CompanyValue(models.Model):
>> company = models.ForeignKey('Company', on_delete=models.CASCADE)
>> value = FloatField
>>
>> This pool of threads return all lists, what I combine, filter and want
>> put to database in one bulk_create call.
>> Suddenly, I found, company.id is not ready to be linked in CompanyValue,
>> follow code does not works:
>> Company.objects.bulk_create(companies)
>> CompanyValue.objects.bulk_create(values)  # value.company_id is null
>> here
>>
>> No way to save objects in my threads, because I need to filter objects
>> and can do it only when all of them are collected. Also, it has performance
>> issues 100k+ of requests is slowly enough. I have two ways to resolve:
>> 1. I can make intermediate class or tuple and create CompanyValue objects
>> only when companies is saved to db. Hard to support, hard to filter, not so
>> clean.
>> 2. I can use dirty hack to update _id field:
>> for v in values:
>> v.company = v.company
>>
>> Can you advice more ways for me? It seems, I don't know something from
>> django features to make it elegant.
>> I see 11 years old issue here (https://code.djangoproject.com/ticket/9553
>> ) and it marked as
>> intended behaviour.
>>
>> --
>> 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/3d62beaf-7fbf-492f-b998-1539f45cd7a0%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/CAP5HUWrC747ZHLWPCf7UK%2BZvZRDAcxDMxk7ewE4d4UhZAHpB7g%40mail.gmail.com
> 
> .
>


-- 
dvenum
dvenum...@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/CAHBRYSdWJ8ongd7Z35sgSc1GefmbG-iv52MXobY%3DOLfXLAxE3g%40mail.gmail.com.


Groups and summarys in template

2019-11-29 Thread Elias Coutinho
Good afternoon people!

I have the following querysets:

 accounts = Account.objects.filter (person__is_representative = False) 
.order_by 
('due date')
 groups = Account.objects.values ('due_date'). annotate (total_day = Sum 
('sold_value')). order_by ('due_date')


Accounts Returns a List of Information Sorted by Due Date
groups returns another list sorted and grouped by due date

I would like django to place a total groups in the template below the line 
of accounts when it realizes that the next due date is different from the 
previous one, ie totaling by date.

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/8ea05b06-1eb1-4de3-8787-6d80570a6283%40googlegroups.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread Jonathan Duclos


On Friday, 29 November 2019 09:42:00 UTC-3, EMPOWER EXCEL wrote:
>
> cqn some body helps me to correct this error while running *python 
> manager.py runeserver *
> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$ 
> python manage.py runserver
> Performing system checks...
> System check identified no issues (0 silenced).
> Unhandled exception in thread started by 
> Traceback (most recent call last):
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
>  
> line 228, in wrapper
> fn(*args, **kwargs)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
>  
> line 127, in inner_run
> self.check_migrations()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
>  
> line 422, in check_migrations
> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
>  
> line 20, in __init__
> self.loader = MigrationLoader(self.connection)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>  
> line 52, in __init__
> self.build_graph()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>  
> line 210, in build_graph
> self.applied_migrations = recorder.applied_migrations()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 65, in applied_migrations
> self.ensure_schema()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>  
> line 52, in ensure_schema
> if self.Migration._meta.db_table in 
> self.connection.introspection.table_names(self.connection.cursor()):
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 254, in cursor
> return self._cursor()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 229, in _cursor
> self.ensure_connection()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
> self.connect()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
>  
> line 94, in __exit__
> six.reraise(dj_exc_type, dj_exc_value, traceback)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 213, in ensure_connection
> self.connect()
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>  
> line 189, in connect
> self.connection = self.get_new_connection(conn_params)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
>  
> line 176, in get_new_connection
> connection = Database.connect(**conn_params)
>   File 
> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
>  
> line 126, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> django.db.utils.OperationalError: FATAL:  password authentication failed 
> for user "postgres"
> FATAL:  password authentication failed for user "postgres"
>


I've the same problem, but I was inputing a wrong string in field password, 
do you checked if as wrong?  

-- 
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/5bba54a0-4458-4743-8a1c-f040f1ad4b46%40googlegroups.com.


Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Charles Lee
 I have an idea.

   1. `bulk_create` all companies.
   2. `Filter`(SELECT) all `Company` and make it dictionary for retrieving 
   company pk fast.
   3. 
  1. company_dict = {
’Name’: ‘pk’,
...
  }
  4. Create a list of `CompanyValue` with company name and company_dict.
   5. `bulk_create` the list.


I'm not sure if it will work because I haven't implemented it, but I hope 
it helps. 

2019년 11월 29일 금요일 오후 9시 42분 0초 UTC+9, Maxim Bulatov 님의 말:
>
> Hello,
>
> I have lot of lists like follow:
> (Name1): (V1, V2, V3, V4, ..)
>
> And I use many threads to create many db objects:
> company = Company(Name)
> for x in vector:
> v = CompanyValue(company=company, value=x)
> values.append(v)
>
> class CompanyValue(models.Model):
> company = models.ForeignKey('Company', on_delete=models.CASCADE)
> value = FloatField
>
> This pool of threads return all lists, what I combine, filter and want put 
> to database in one bulk_create call.
> Suddenly, I found, company.id is not ready to be linked in CompanyValue, 
> follow code does not works:
> Company.objects.bulk_create(companies)
> CompanyValue.objects.bulk_create(values)  # value.company_id is null 
> here
>
> No way to save objects in my threads, because I need to filter objects and 
> can do it only when all of them are collected. Also, it has performance 
> issues 100k+ of requests is slowly enough. I have two ways to resolve:
> 1. I can make intermediate class or tuple and create CompanyValue objects 
> only when companies is saved to db. Hard to support, hard to filter, not so 
> clean.
> 2. I can use dirty hack to update _id field:
> for v in values:
> v.company = v.company
>
> Can you advice more ways for me? It seems, I don't know something from 
> django features to make it elegant.
> I see 11 years old issue here (https://code.djangoproject.com/ticket/9553 
> ) and it marked as 
> intended behaviour.
>

-- 
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/d6da72b2-6ce3-4b4b-8916-019a06c61f82%40googlegroups.com.


Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Charles Lee
 I have an idea.

   1. `bulk_create` all companies.
   2. `Filter`(SELECT) all `Company` and make it dictionary for retrieving 
   company fast.
   3. 
  1. company_dict = {
’Name’: ‘pk’,
...
  }
  4. Create a list of `CompanyValue` with company name and company_dict.
   5. `bulk_create` the list.


I'm not sure if it will work because I haven't implemented it, but I hope 
it helps. 

2019년 11월 29일 금요일 오후 9시 42분 0초 UTC+9, Maxim Bulatov 님의 말:
>
> Hello,
>
> I have lot of lists like follow:
> (Name1): (V1, V2, V3, V4, ..)
>
> And I use many threads to create many db objects:
> company = Company(Name)
> for x in vector:
> v = CompanyValue(company=company, value=x)
> values.append(v)
>
> class CompanyValue(models.Model):
> company = models.ForeignKey('Company', on_delete=models.CASCADE)
> value = FloatField
>
> This pool of threads return all lists, what I combine, filter and want put 
> to database in one bulk_create call.
> Suddenly, I found, company.id is not ready to be linked in CompanyValue, 
> follow code does not works:
> Company.objects.bulk_create(companies)
> CompanyValue.objects.bulk_create(values)  # value.company_id is null 
> here
>
> No way to save objects in my threads, because I need to filter objects and 
> can do it only when all of them are collected. Also, it has performance 
> issues 100k+ of requests is slowly enough. I have two ways to resolve:
> 1. I can make intermediate class or tuple and create CompanyValue objects 
> only when companies is saved to db. Hard to support, hard to filter, not so 
> clean.
> 2. I can use dirty hack to update _id field:
> for v in values:
> v.company = v.company
>
> Can you advice more ways for me? It seems, I don't know something from 
> django features to make it elegant.
> I see 11 years old issue here (https://code.djangoproject.com/ticket/9553 
> ) and it marked as 
> intended behaviour.
>

-- 
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/af2a0f27-7234-4210-8627-1ad8982da805%40googlegroups.com.


Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Dvenum
Interest idea and it works, but not necessary:
company = Company()
#company.id is None
companies.append(company)
Company.objects.bulk_create(companies)
#company.id is 1

Instead to ask pk from database, it can be used from
company_value.company.id. Django save pk value to internal meta
(models/base.py) and does not update it. This works too:
value.company = value.company # pk updated

I want to ask, each child object should be created only when parent is
saved to db? Maybe django has something to cover this case?


On Sat, Nov 30, 2019 at 7:52 AM Charles Lee  wrote:

> I have an idea.
>
>1. `bulk_create` all companies.
>2. `Filter`(SELECT) all `Company` and make it dictionary for
>retrieving company fast.
>3.
>   1. company_dict = {
> ’Name’: ‘pk’,
> ...
>   }
>   4. Create a list of `CompanyValue` with company name and
>company_dict.
>5. `bulk_create` the list.
>
>
> I'm not sure if it will work because I haven't implemented it, but I hope
> it helps.
>
> 2019년 11월 29일 금요일 오후 9시 42분 0초 UTC+9, Maxim Bulatov 님의 말:
>>
>> Hello,
>>
>> I have lot of lists like follow:
>> (Name1): (V1, V2, V3, V4, ..)
>>
>> And I use many threads to create many db objects:
>> company = Company(Name)
>> for x in vector:
>> v = CompanyValue(company=company, value=x)
>> values.append(v)
>>
>> class CompanyValue(models.Model):
>> company = models.ForeignKey('Company', on_delete=models.CASCADE)
>> value = FloatField
>>
>> This pool of threads return all lists, what I combine, filter and want
>> put to database in one bulk_create call.
>> Suddenly, I found, company.id is not ready to be linked in CompanyValue,
>> follow code does not works:
>> Company.objects.bulk_create(companies)
>> CompanyValue.objects.bulk_create(values)  # value.company_id is null
>> here
>>
>> No way to save objects in my threads, because I need to filter objects
>> and can do it only when all of them are collected. Also, it has performance
>> issues 100k+ of requests is slowly enough. I have two ways to resolve:
>> 1. I can make intermediate class or tuple and create CompanyValue objects
>> only when companies is saved to db. Hard to support, hard to filter, not so
>> clean.
>> 2. I can use dirty hack to update _id field:
>> for v in values:
>> v.company = v.company
>>
>> Can you advice more ways for me? It seems, I don't know something from
>> django features to make it elegant.
>> I see 11 years old issue here (https://code.djangoproject.com/ticket/9553
>> ) and it marked as
>> intended behaviour.
>>
> --
> 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/af2a0f27-7234-4210-8627-1ad8982da805%40googlegroups.com
> 
> .
>


-- 
dvenum
dvenum...@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/CAHBRYSd1MC5mL3oWTfzqc%2BXXcWxVnDqLpJ5HsEGk2GHFd917eQ%40mail.gmail.com.


Re: Groups and summarys in template

2019-11-29 Thread Dvenum
Not sure I understand, what you doing, but you may use F() expression to
compare fields in the query:
https://docs.djangoproject.com/en/2.2/ref/models/expressions/#f-expressions

On Sat, Nov 30, 2019 at 2:36 AM Elias Coutinho 
wrote:

> Good afternoon people!
>
> I have the following querysets:
>
>  accounts = Account.objects.filter (person__is_representative = False)
> .order_by ('due date')
>  groups = Account.objects.values ('due_date'). annotate (total_day =
> Sum ('sold_value')). order_by ('due_date')
>
>
> Accounts Returns a List of Information Sorted by Due Date
> groups returns another list sorted and grouped by due date
>
> I would like django to place a total groups in the template below the line
> of accounts when it realizes that the next due date is different from the
> previous one, ie totaling by date.
>
> 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/8ea05b06-1eb1-4de3-8787-6d80570a6283%40googlegroups.com
> 
> .
>


-- 
dvenum
dvenum...@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/CAHBRYSeBvJr6cDTRtUXEqsJFb03cZw66G2jk1DqY_7P7-jYq1g%40mail.gmail.com.


Re: Groups and summarys in template

2019-11-29 Thread Integr@te System
Hi,

You can sellect from SO(relate to 'sold_value') as retrieve from new SO
base on current time.

Or If due date time == datetime now && 'due date' != 0: retrieve 'due date'


On Sat, Nov 30, 2019, 02:36 Elias Coutinho  wrote:

> Good afternoon people!
>
> I have the following querysets:
>
>  accounts = Account.objects.filter (person__is_representative = False)
> .order_by ('due date')
>  groups = Account.objects.values ('due_date'). annotate (total_day =
> Sum ('sold_value')). order_by ('due_date')
>
>
> Accounts Returns a List of Information Sorted by Due Date
> groups returns another list sorted and grouped by due date
>
> I would like django to place a total groups in the template below the line
> of accounts when it realizes that the next due date is different from the
> previous one, ie totaling by date.
>
> 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/8ea05b06-1eb1-4de3-8787-6d80570a6283%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/CAP5HUWo1o%3DmV%3D0Da27q8HzDp5Gu9T9cHzd9a44hhwghB1LN68A%40mail.gmail.com.


Re: Update _id field before .save() for ForeignKey

2019-11-29 Thread Integr@te System
Hi Dvenun,

Bc of  Django implement accord to python, of cause child inherit from
parent existence.


https://docs.python.org/3.7/library/functions.html#id


On Sat, Nov 30, 2019, 13:30 Dvenum  wrote:

> Interest idea and it works, but not necessary:
> company = Company()
> #company.id is None
> companies.append(company)
> Company.objects.bulk_create(companies)
> #company.id is 1
>
> Instead to ask pk from database, it can be used from
> company_value.company.id. Django save pk value to internal meta
> (models/base.py) and does not update it. This works too:
> value.company = value.company # pk updated
>
> I want to ask, each child object should be created only when parent is
> saved to db? Maybe django has something to cover this case?
>
>
> On Sat, Nov 30, 2019 at 7:52 AM Charles Lee 
> wrote:
>
>> I have an idea.
>>
>>1. `bulk_create` all companies.
>>2. `Filter`(SELECT) all `Company` and make it dictionary for
>>retrieving company fast.
>>3.
>>   1. company_dict = {
>> ’Name’: ‘pk’,
>> ...
>>   }
>>   4. Create a list of `CompanyValue` with company name and
>>company_dict.
>>5. `bulk_create` the list.
>>
>>
>> I'm not sure if it will work because I haven't implemented it, but I hope
>> it helps.
>>
>> 2019년 11월 29일 금요일 오후 9시 42분 0초 UTC+9, Maxim Bulatov 님의 말:
>>>
>>> Hello,
>>>
>>> I have lot of lists like follow:
>>> (Name1): (V1, V2, V3, V4, ..)
>>>
>>> And I use many threads to create many db objects:
>>> company = Company(Name)
>>> for x in vector:
>>> v = CompanyValue(company=company, value=x)
>>> values.append(v)
>>>
>>> class CompanyValue(models.Model):
>>> company = models.ForeignKey('Company', on_delete=models.CASCADE)
>>> value = FloatField
>>>
>>> This pool of threads return all lists, what I combine, filter and want
>>> put to database in one bulk_create call.
>>> Suddenly, I found, company.id is not ready to be linked in
>>> CompanyValue, follow code does not works:
>>> Company.objects.bulk_create(companies)
>>> CompanyValue.objects.bulk_create(values)  # value.company_id is
>>> null here
>>>
>>> No way to save objects in my threads, because I need to filter objects
>>> and can do it only when all of them are collected. Also, it has performance
>>> issues 100k+ of requests is slowly enough. I have two ways to resolve:
>>> 1. I can make intermediate class or tuple and create CompanyValue
>>> objects only when companies is saved to db. Hard to support, hard to
>>> filter, not so clean.
>>> 2. I can use dirty hack to update _id field:
>>> for v in values:
>>> v.company = v.company
>>>
>>> Can you advice more ways for me? It seems, I don't know something from
>>> django features to make it elegant.
>>> I see 11 years old issue here (
>>> https://code.djangoproject.com/ticket/9553
>>> ) and it marked as
>>> intended behaviour.
>>>
>> --
>> 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/af2a0f27-7234-4210-8627-1ad8982da805%40googlegroups.com
>> 
>> .
>>
>
>
> --
> dvenum
> dvenum...@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/CAHBRYSd1MC5mL3oWTfzqc%2BXXcWxVnDqLpJ5HsEGk2GHFd917eQ%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/CAP5HUWqW7gZVR1u6-%2BAkMhB5dZeRHiXzLrSQvmiL7O3diT9OfA%40mail.gmail.com.


Re: HELP HELP FATAL: password authentication failed for user "postgres"

2019-11-29 Thread Integr@te System
Hi freind,

the last time u recieved an email to check config with content of many
fields and connection.

If u see wrong password field, check in app and db setting.

On Sat, Nov 30, 2019, 04:51 Jonathan Duclos 
wrote:

>
>
> On Friday, 29 November 2019 09:42:00 UTC-3, EMPOWER EXCEL wrote:
>>
>> cqn some body helps me to correct this error while running *python
>> manager.py runeserver *
>> (analyseprotection) flavien@flavien-VirtualBox:~/MyProjects/alertprot$
>> python manage.py runserver
>> Performing system checks...
>> System check identified no issues (0 silenced).
>> Unhandled exception in thread started by 
>> Traceback (most recent call last):
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/utils/autoreload.py",
>> line 228, in wrapper
>> fn(*args, **kwargs)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py",
>> line 127, in inner_run
>> self.check_migrations()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/core/management/base.py",
>> line 422, in check_migrations
>> executor = MigrationExecutor(connections[DEFAULT_DB_ALIAS])
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/executor.py",
>> line 20, in __init__
>> self.loader = MigrationLoader(self.connection)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>> line 52, in __init__
>> self.build_graph()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/loader.py",
>> line 210, in build_graph
>> self.applied_migrations = recorder.applied_migrations()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>> line 65, in applied_migrations
>> self.ensure_schema()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/migrations/recorder.py",
>> line 52, in ensure_schema
>> if self.Migration._meta.db_table in
>> self.connection.introspection.table_names(self.connection.cursor()):
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 254, in cursor
>> return self._cursor()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 229, in _cursor
>> self.ensure_connection()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 213, in ensure_connection
>> self.connect()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/utils.py",
>> line 94, in __exit__
>> six.reraise(dj_exc_type, dj_exc_value, traceback)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 213, in ensure_connection
>> self.connect()
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/base/base.py",
>> line 189, in connect
>> self.connection = self.get_new_connection(conn_params)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/django/db/backends/postgresql/base.py",
>> line 176, in get_new_connection
>> connection = Database.connect(**conn_params)
>>   File
>> "/home/flavien/MyProjects/analyseprotection/local/lib/python2.7/site-packages/psycopg2/__init__.py",
>> line 126, in connect
>> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
>> django.db.utils.OperationalError: FATAL:  password authentication failed
>> for user "postgres"
>> FATAL:  password authentication failed for user "postgres"
>>
>
>
> I've the same problem, but I was inputing a wrong string in field
> password, do you checked if as wrong?
>
> --
> 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/5bba54a0-4458-4743-8a1c-f040f1ad4b46%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/CAP5HUWrqRAm