Re: ValueError: set_wakeup_fd only works in main thread on Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19

2020-02-23 Thread Siddharth Agarwal
Thx jlgimeno71

I am able to reproduce this issue using Python 3.8.2rc2 released on 17th 
Feb. As next steps moving to Python 3.7.

Regards,
Siddharth Agarwal



On Sunday, February 23, 2020 at 11:05:42 AM UTC+5:30, jlgimeno71 wrote:
>
>
>
> On Sat, Feb 22, 2020 at 9:02 PM Siddharth Agarwal  > wrote:
>
>> Hello 
>> When I run my Django Web application with Apache2.4.41 + Python 3.8.1 + 
>> Django 3.0.2 + MySQL 8.0.19 on Windows 10 Professional 64 bit version it 
>> throws Value Error at /. set_wakeup_fd only works in main thread.
>>
>> This issue was a result of regression in Python 3.8 and was fixed in 
>> November in later builds of Python. For more details - 
>> https://bugs.python.org/issue38563.
>>
>> Stacktrace of the error is as follows - 
>>
>> Environment:
>>
>>
>> Request Method: GET
>> Request URL: http://127.0.0.1/
>>
>> Django Version: 3.0.2
>> Python Version: 3.8.1
>> Installed Applications:
>> ['Analysis.apps.AnalysisConfig',
>> 'django.contrib.admin',
>> 'django.contrib.auth',
>> 'django.contrib.contenttypes',
>> 'django.contrib.sessions',
>> 'django.contrib.messages',
>> 'django.contrib.staticfiles',
>> 'django.contrib.humanize']
>> Installed Middleware:
>> ['django.middleware.security.SecurityMiddleware',
>> 'django.contrib.sessions.middleware.SessionMiddleware',
>> 'django.middleware.common.CommonMiddleware',
>> 'django.middleware.csrf.CsrfViewMiddleware',
>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>> 'django.contrib.messages.middleware.MessageMiddleware',
>> 'django.middleware.clickjacking.XFrameOptionsMiddleware']
>>
>>
>>
>> Traceback (most recent call last):
>>   File "c:\python38\lib\site-packages\django\core\handlers\exception.py", 
>> line 34, in inner
>> response = get_response(request)
>>   File "c:\python38\lib\site-packages\django\core\handlers\base.py", 
>> line 115, in _get_response
>> response = self.process_exception_by_middleware(e, request)
>>   File "c:\python38\lib\site-packages\django\core\handlers\base.py", 
>> line 113, in _get_response
>> response = wrapped_callback(request, *callback_args, **
>> callback_kwargs)
>>   File "F:\IndianMarketAnalysis\ISMA\Analysis\views.py", line 8, in home
>> date_list = dict(d.date_list())
>>   File "F:\IndianMarketAnalysis\ISMA\Analysis\models.py", line 7, in 
>> date_list
>> with connection.cursor() as cursor:
>>   File "c:\python38\lib\site-packages\django\utils\asyncio.py", line 19, 
>> in inner
>> event_loop = asyncio.get_event_loop()
>>   File "c:\python38\lib\asyncio\events.py", line 636, in get_event_loop
>> self.set_event_loop(self.new_event_loop())
>>   File "c:\python38\lib\asyncio\events.py", line 656, in new_event_loop
>> return self._loop_factory()
>>   File "c:\python38\lib\asyncio\windows_events.py", line 310, in __init__
>> super().__init__(proactor)
>>   File "c:\python38\lib\asyncio\proactor_events.py", line 632, in 
>> __init__
>> signal.set_wakeup_fd(self._csock.fileno())
>>
>> Exception Type: ValueError at /
>> Exception Value: set_wakeup_fd only works in main thread 
>>
>>
>>
>> Further, this application works very well on local Development 
>> Environment using - python manage.py runserver.
>>
>> Please suggest the next steps to move forward.
>>  
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/5dceb145-7d89-4bd0-a3cf-24dd5155891a%40googlegroups.com
>>  
>> 
>> .
>>
>
>  This is fixed and will be released with 3.8.2, per what I've read.  If 
> running 3.8.2 release candidate 2 isn't an option, is downgrading to Python 
> 3.7 an option?
>
> -Jorge
>

-- 
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/c2fbea7b-46f0-472b-9d40-628e000e34f8%40googlegroups.com.


Struggling on how to divide our ERP according to the Compary regional offices may someone help.

2020-02-23 Thread dumbaclassics
Hello Family.We have been developing in django for 2years now. Our company 
recently migrated from a manual system to an ERP and we opted for Django. We 
have a nice working ERP  with accounting, inventory, hr, crm and scheduling 
modules.The problem is that the Company has got regional branches and now they 
would want us to come with a solution where the Head Office has access to 
summary data an all its branches, branches managing their own affairs without 
them stumbling on one another. We have been researching on solutions and 
django_tenants did come up when it comes to seperation of databases by schemas 
but still we dont see how then the Company head office can have an overall 
access to its branches at the same time offer service based on utilising the 
System Modules. Any suggestion would be much appreciatedThanksSent from my 
Samsung Galaxy smartphone.

-- 
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/i80aomak4baf6ivi8choq8xy.1582455839916%40email.android.com.


Re: ValueError: set_wakeup_fd only works in main thread on Apache2.4.41 + Python 3.8.1 + Django 3.0.2 + MySQL 8.0.19

2020-02-23 Thread Siddharth Agarwal
Hello jlgimeno71,

This issue does not happen with Python 3.7. And I am able to move forward.

Thanks and Regards,
Siddharth Agarwal



On Sunday, February 23, 2020 at 4:49:05 PM UTC+5:30, Siddharth Agarwal 
wrote:
>
> Thx jlgimeno71
>
> I am able to reproduce this issue using Python 3.8.2rc2 released on 17th 
> Feb. As next steps moving to Python 3.7.
>
> Regards,
> Siddharth Agarwal
>
>
>
> On Sunday, February 23, 2020 at 11:05:42 AM UTC+5:30, jlgimeno71 wrote:
>>
>>
>>
>> On Sat, Feb 22, 2020 at 9:02 PM Siddharth Agarwal  
>> wrote:
>>
>>> Hello 
>>> When I run my Django Web application with Apache2.4.41 + Python 3.8.1 + 
>>> Django 3.0.2 + MySQL 8.0.19 on Windows 10 Professional 64 bit version it 
>>> throws Value Error at /. set_wakeup_fd only works in main thread.
>>>
>>> This issue was a result of regression in Python 3.8 and was fixed in 
>>> November in later builds of Python. For more details - 
>>> https://bugs.python.org/issue38563.
>>>
>>> Stacktrace of the error is as follows - 
>>>
>>> Environment:
>>>
>>>
>>> Request Method: GET
>>> Request URL: http://127.0.0.1/
>>>
>>> Django Version: 3.0.2
>>> Python Version: 3.8.1
>>> Installed Applications:
>>> ['Analysis.apps.AnalysisConfig',
>>> 'django.contrib.admin',
>>> 'django.contrib.auth',
>>> 'django.contrib.contenttypes',
>>> 'django.contrib.sessions',
>>> 'django.contrib.messages',
>>> 'django.contrib.staticfiles',
>>> 'django.contrib.humanize']
>>> Installed Middleware:
>>> ['django.middleware.security.SecurityMiddleware',
>>> 'django.contrib.sessions.middleware.SessionMiddleware',
>>> 'django.middleware.common.CommonMiddleware',
>>> 'django.middleware.csrf.CsrfViewMiddleware',
>>> 'django.contrib.auth.middleware.AuthenticationMiddleware',
>>> 'django.contrib.messages.middleware.MessageMiddleware',
>>> 'django.middleware.clickjacking.XFrameOptionsMiddleware']
>>>
>>>
>>>
>>> Traceback (most recent call last):
>>>   File "c:\python38\lib\site-packages\django\core\handlers\exception.py", 
>>> line 34, in inner
>>> response = get_response(request)
>>>   File "c:\python38\lib\site-packages\django\core\handlers\base.py", 
>>> line 115, in _get_response
>>> response = self.process_exception_by_middleware(e, request)
>>>   File "c:\python38\lib\site-packages\django\core\handlers\base.py", 
>>> line 113, in _get_response
>>> response = wrapped_callback(request, *callback_args, **
>>> callback_kwargs)
>>>   File "F:\IndianMarketAnalysis\ISMA\Analysis\views.py", line 8, in home
>>> date_list = dict(d.date_list())
>>>   File "F:\IndianMarketAnalysis\ISMA\Analysis\models.py", line 7, in 
>>> date_list
>>> with connection.cursor() as cursor:
>>>   File "c:\python38\lib\site-packages\django\utils\asyncio.py", line 19, 
>>> in inner
>>> event_loop = asyncio.get_event_loop()
>>>   File "c:\python38\lib\asyncio\events.py", line 636, in get_event_loop
>>> self.set_event_loop(self.new_event_loop())
>>>   File "c:\python38\lib\asyncio\events.py", line 656, in new_event_loop
>>> return self._loop_factory()
>>>   File "c:\python38\lib\asyncio\windows_events.py", line 310, in 
>>> __init__
>>> super().__init__(proactor)
>>>   File "c:\python38\lib\asyncio\proactor_events.py", line 632, in 
>>> __init__
>>> signal.set_wakeup_fd(self._csock.fileno())
>>>
>>> Exception Type: ValueError at /
>>> Exception Value: set_wakeup_fd only works in main thread 
>>>
>>>
>>>
>>> Further, this application works very well on local Development 
>>> Environment using - python manage.py runserver.
>>>
>>> Please suggest the next steps to move forward.
>>>  
>>>
>>> -- 
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/django-users/5dceb145-7d89-4bd0-a3cf-24dd5155891a%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>
>>  This is fixed and will be released with 3.8.2, per what I've read.  If 
>> running 3.8.2 release candidate 2 isn't an option, is downgrading to Python 
>> 3.7 an option?
>>
>> -Jorge
>>
>

-- 
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/7a4c6ecd-a6c5-4689-a93f-dc2ae96fae44%40googlegroups.com.


[ANN] copernic v0.1.1, Versioned structured data, with change-request mechanic, at scale.

2020-02-23 Thread Amirouche Boubekki
I am pleased to announce the immediate availability of copernic v0.1.1.

This project wants to be a scalable application that support a 
change-request
mechanic similar to github pull-request or gitlab merge-request, on any
structured data.  That includes relational data, graph-like data and tabular
data.  Eventually, it should scale both in terms of data size and number of 
contributions.

Like wikipedia or wikidata, there is a single version of truth. In other 
words, 
every user gets the same data, there is no micro per user data repositories.

Change-request work in a way that similar to git stash, that is the diff, 
additions 
and deletions, is stored in the database like the rest of the data.  Until 
the change
is applied by a super user, the data part of the change-request is 
invisible outside
the change request.

Once a super user applies the change, that is merely swapping a single 
`None` 
value with a timestamp, the history is properly serialized realizing a 
single
branch history.

It it possible to do time traveling queries, like freebase did. It is not 
exposed in 
the web user interface.

There is always an up-to-date image of the latest data, to speed up 
queries. 
But the history only store the differences between successive versions.

The code is at: https://github.com/amirouche/copernic

A demo is available at: http://copernic.space/about/

The license is AGPLv3+

-- 
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/7e962b09-4378-4b50-abbd-afd0c8c97415%40googlegroups.com.


Asking about Django

2020-02-23 Thread nawal benmohamed
*Does Django contain a library with component for implementation*

-- 
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/241fa391-6bc9-4246-a3d3-072540604dbe%40googlegroups.com.


Re: Asking about Django

2020-02-23 Thread Motaz Hejaze
your question is not clear to answer ,
please speak in your first language ( arabic ) or put more details in your
question ..

On Sun, Feb 23, 2020 at 3:51 PM nawal benmohamed <
nawoulabenmoham...@gmail.com> wrote:

> *Does Django contain a library with component for implementation*
>
> --
> 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/241fa391-6bc9-4246-a3d3-072540604dbe%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/CAHV4E-c5_fC9OCwrX%2BO3nu32-zCZ1cvONAzcgWQBRsNOobkKjw%40mail.gmail.com.


My newly added model doesn't appear on the user's side of the site

2020-02-23 Thread fred rick
The new model appears on the admin site but doesn't appear on the user's side. 
I set the rules to (null=True, blank=False).

What could be the possible solution 

-- 
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/-g249uq-19q12jkbcyjaxcwkix921d6kxcinyqw57cxd6kxoix-nk5qfb2ty049-867p86-vj4qqh-la3ooj8m7zyw-pk1q6k-bcpesh6gy2s2-nxe52ndnug9xb4q1nqgzlhj-44h9b-ppoyzefo4e4p.1582472048465%40email.android.com.


Selecting all and posting

2020-02-23 Thread Isaac Ndutumo
Am working on a hospital system where the billing model requires users to 
select varies items from the bill list and post them by creating a receipt 
or an invoice. Am new in JavaScript programming combined with Django.

Any help on below tasks will be highly appreciated 

   1. Select all or few and post either as a receipt or invoice. 
   2. Show total of selected items dynamically 


  Find attached capture for bill view.

-- 
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/1b59fa26-910c-4fb6-81c4-a7b38291abf7%40googlegroups.com.


Django Migration gives an error with OneToOneField

2020-02-23 Thread maninder singh Kumar
I am working on an application with two databases and two different
dbRouters.  On migrating a model with a OneToOneField I get the following
error :

django.db.utils.OperationalError: (1824, "Failed to open the referenced
table 'auth_user'")


The auth dbRouter is for the [auth, sessions, contenttypes, admin] apps
while the Redford dbRouter is for the main app.

Below is the code for the routers :


*auth dbRouter*


class AuthRouter:
"""
A router to control all database operations on models in the
auth and contenttypes applications.
"""
route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')

def db_for_read(self, model, **hints):
"""
Attempts to read auth and contenttypes models go to auth_db.
"""
if model._meta.app_label in self.route_app_labels:
return "default"
return False

def db_for_write(self, model, **hints):
"""
Attempts to write auth and contenttypes models go to auth_db.
"""
if model._meta.app_label in self.route_app_labels:
return "default"
return False

def allow_relation(self, obj1, obj2, **hints):
"""
Allow relations if a model in the auth or contenttypes apps is
involved.
"""

if (obj1._meta.app_label in self.route_app_labels or
obj2._meta.app_label == 'julia' or 'redford'
):
return True
return None

def allow_migrate(self, db, app_label, model_name=None, **hints):
"""
Make sure the auth and contenttypes apps only appear in the
'auth_db' database.
"""


if db == 'default':
# Migrate Django core app models if current database is home
if app_label in ('auth','admin','sessions','contenttypes'):
return True

else:
return False

# Non Django core app models should not be migrated if
database is home
# Other database should not migrate Django core app models


elif app_label in ['auth','admin','sessions','contenttypes']:
return False
# Otherwise no opinion, defer to other routers or default database
return None



*Redford dbRouter*


class RedfordRouter(object):

route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')

def db_for_read(self, model, **hints):
if model._meta.app_label == 'redford':
  return 'redford_db'
return False

def db_for_write(self, model, **hints):
if model._meta.app_label == 'redford':
  return 'redford_db'
return False

def allow_relation(self, obj1, obj2, **hints):
if obj1._meta.app_label == 'redford' or obj2._meta.app_label ==
'auth':
return True
return None

def allow_migrate(self, db, app_label, model_name=None, **hints):

if db == 'default' or app_label in self.route_app_labels:
print(db, app_label)
return None
elif db == 'redford_db':
if app_label == 'redford':
return True
return False
return None


The code for the models is as below :


class Employer(models.Model):
 emp_Name = models.OneToOneField(User, on_delete=models.CASCADE,
 null=True)
 emp_Company = models.CharField(max_length=100)
 emp_Address = models.CharField(max_length=500)
 emp_Tel = models.CharField(max_length=100)
 emp_JobTitle = models.CharField(max_length=200, null=True)
 emp_JobDesc = models.CharField(max_length=600, null=False)

 def __str__(self):
 return self.emp_Name


Hope we can work it out


regards


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar


-- 
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/CABOHK3QsWztSogPx_RzbYcZ46WyK0cHV8JxXBuRSbr2epeQKhg%40mail.gmail.com.


Re: Django - CreateView not saving form with nested formset

2020-02-23 Thread Integr@te System
Hi Shazia,

Plz search somewhere like this if u see for helpful:
https://github.com/philgyford/django-nested-inline-formsets-example



On Sun, Feb 23, 2020, 14:01 Shazia Nusrat  wrote:

> Hi,
>
> Can someone help to answer the question in link?
> Also I've been trying to get CreateView working with 5 inline formsets but
> couldn't make it work.
>
> Will really appreciate your help if someone can help me with working
> example.
>
> Question:
> https://stackoverflow.com/questions/60354976/django-createview-not-saving-form-with-nested-formset
>
> Regards,
>
> Shazia
>
> --
> 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/CAD83tOx%3D0DBWuGQT4c-zp0gK7PGm5JG2KQnKgCjOWD7q7NoscQ%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/CAP5HUWroUmURgQPiLGDC8XRA34vdVEiZQfxC_BbZPBBaxE7k3A%40mail.gmail.com.


Re: My newly added model doesn't appear on the user's side of the site

2020-02-23 Thread maninder singh Kumar
If it is appearing on the admin site then it has been updated on the
database.  It is possible that two things could cause the problem :
1.  The right query is not being used to generate a result.
2.  The right templating is not been used.

regards


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Sun, Feb 23, 2020 at 9:08 PM fred rick  wrote:

> The new model appears on the admin site but doesn't appear on the user's
> side. I set the rules to (null=True, blank=False).
>
> What could be the possible solution
>
> --
> 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/-g249uq-19q12jkbcyjaxcwkix921d6kxcinyqw57cxd6kxoix-nk5qfb2ty049-867p86-vj4qqh-la3ooj8m7zyw-pk1q6k-bcpesh6gy2s2-nxe52ndnug9xb4q1nqgzlhj-44h9b-ppoyzefo4e4p.1582472048465%40email.android.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/CABOHK3QCiLOc3ZQsMLfWzUMNUWsq0_m%3Di%2Br6iRvju6KRWbeVHw%40mail.gmail.com.


Re: Django Migration gives an error with OneToOneField

2020-02-23 Thread Integr@te System
Hi,

Would u consider any relative details with result!?

Or try some cmd to more status:
https://docs.djangoproject.com/en/2.2/topics/migrations/

On Mon, Feb 24, 2020, 00:43 maninder singh Kumar 
wrote:

> I am working on an application with two databases and two different
> dbRouters.  On migrating a model with a OneToOneField I get the following
> error :
>
> django.db.utils.OperationalError: (1824, "Failed to open the referenced
> table 'auth_user'")
>
>
> The auth dbRouter is for the [auth, sessions, contenttypes, admin] apps
> while the Redford dbRouter is for the main app.
>
> Below is the code for the routers :
>
>
> *auth dbRouter*
>
>
> class AuthRouter:
> """
> A router to control all database operations on models in the
> auth and contenttypes applications.
> """
> route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')
>
> def db_for_read(self, model, **hints):
> """
> Attempts to read auth and contenttypes models go to auth_db.
> """
> if model._meta.app_label in self.route_app_labels:
> return "default"
> return False
>
> def db_for_write(self, model, **hints):
> """
> Attempts to write auth and contenttypes models go to auth_db.
> """
> if model._meta.app_label in self.route_app_labels:
> return "default"
> return False
>
> def allow_relation(self, obj1, obj2, **hints):
> """
> Allow relations if a model in the auth or contenttypes apps is
> involved.
> """
>
> if (obj1._meta.app_label in self.route_app_labels or
> obj2._meta.app_label == 'julia' or 'redford'
> ):
> return True
> return None
>
> def allow_migrate(self, db, app_label, model_name=None, **hints):
> """
> Make sure the auth and contenttypes apps only appear in the
> 'auth_db' database.
> """
>
>
> if db == 'default':
> # Migrate Django core app models if current database is home
> if app_label in ('auth','admin','sessions','contenttypes'):
> return True
>
> else:
> return False
>
> # Non Django core app models should not be migrated if
> database is home
> # Other database should not migrate Django core app models
>
>
> elif app_label in ['auth','admin','sessions','contenttypes']:
> return False
> # Otherwise no opinion, defer to other routers or default database
> return None
>
>
>
> *Redford dbRouter*
>
>
> class RedfordRouter(object):
>
> route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')
>
> def db_for_read(self, model, **hints):
> if model._meta.app_label == 'redford':
>   return 'redford_db'
> return False
>
> def db_for_write(self, model, **hints):
> if model._meta.app_label == 'redford':
>   return 'redford_db'
> return False
>
> def allow_relation(self, obj1, obj2, **hints):
> if obj1._meta.app_label == 'redford' or obj2._meta.app_label ==
> 'auth':
> return True
> return None
>
> def allow_migrate(self, db, app_label, model_name=None, **hints):
>
> if db == 'default' or app_label in self.route_app_labels:
> print(db, app_label)
> return None
> elif db == 'redford_db':
> if app_label == 'redford':
> return True
> return False
> return None
>
>
> The code for the models is as below :
>
>
> class Employer(models.Model):
>  emp_Name = models.OneToOneField(User, on_delete=models.CASCADE,
>  null=True)
>  emp_Company = models.CharField(max_length=100)
>  emp_Address = models.CharField(max_length=500)
>  emp_Tel = models.CharField(max_length=100)
>  emp_JobTitle = models.CharField(max_length=200, null=True)
>  emp_JobDesc = models.CharField(max_length=600, null=False)
>
>  def __str__(self):
>  return self.emp_Name
>
>
> Hope we can work it out
>
>
> regards
>
>
> [image: --]
>
> Maninder Kumar
> [image: http://]about.me/maninder.s.kumar
> 
>
>
>
> --
> 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/CABOHK3QsWztSogPx_RzbYcZ46WyK0cHV8JxXBuRSbr2epeQKhg%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 fro

Re: Django Migration gives an error with OneToOneField

2020-02-23 Thread maninder singh Kumar
Here's something else I found, the second time around I run django
migrations, the model does get created in the mysql db.  Once it has popped
in the error I guess it has already created a database table with the
unique field constraint.
However I then have to fake initial to get the django_migrations to tick
the migration as done.

regards


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Mon, Feb 24, 2020 at 12:20 AM Integr@te System 
wrote:

> Hi,
>
> Would u consider any relative details with result!?
>
> Or try some cmd to more status:
> https://docs.djangoproject.com/en/2.2/topics/migrations/
>
> On Mon, Feb 24, 2020, 00:43 maninder singh Kumar <
> maninder.s.ku...@gmail.com> wrote:
>
>> I am working on an application with two databases and two different
>> dbRouters.  On migrating a model with a OneToOneField I get the following
>> error :
>>
>> django.db.utils.OperationalError: (1824, "Failed to open the referenced
>> table 'auth_user'")
>>
>>
>> The auth dbRouter is for the [auth, sessions, contenttypes, admin] apps
>> while the Redford dbRouter is for the main app.
>>
>> Below is the code for the routers :
>>
>>
>> *auth dbRouter*
>>
>>
>> class AuthRouter:
>> """
>> A router to control all database operations on models in the
>> auth and contenttypes applications.
>> """
>> route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')
>>
>> def db_for_read(self, model, **hints):
>> """
>> Attempts to read auth and contenttypes models go to auth_db.
>> """
>> if model._meta.app_label in self.route_app_labels:
>> return "default"
>> return False
>>
>> def db_for_write(self, model, **hints):
>> """
>> Attempts to write auth and contenttypes models go to auth_db.
>> """
>> if model._meta.app_label in self.route_app_labels:
>> return "default"
>> return False
>>
>> def allow_relation(self, obj1, obj2, **hints):
>> """
>> Allow relations if a model in the auth or contenttypes apps is
>> involved.
>> """
>>
>> if (obj1._meta.app_label in self.route_app_labels or
>> obj2._meta.app_label == 'julia' or 'redford'
>> ):
>> return True
>> return None
>>
>> def allow_migrate(self, db, app_label, model_name=None, **hints):
>> """
>> Make sure the auth and contenttypes apps only appear in the
>> 'auth_db' database.
>> """
>>
>>
>> if db == 'default':
>> # Migrate Django core app models if current database is home
>> if app_label in ('auth','admin','sessions','contenttypes'):
>> return True
>>
>> else:
>> return False
>>
>> # Non Django core app models should not be migrated if
>> database is home
>> # Other database should not migrate Django core app models
>>
>>
>> elif app_label in ['auth','admin','sessions','contenttypes']:
>> return False
>> # Otherwise no opinion, defer to other routers or default database
>> return None
>>
>>
>>
>> *Redford dbRouter*
>>
>>
>> class RedfordRouter(object):
>>
>> route_app_labels = ('auth', 'contenttypes', 'sessions', 'admin')
>>
>> def db_for_read(self, model, **hints):
>> if model._meta.app_label == 'redford':
>>   return 'redford_db'
>> return False
>>
>> def db_for_write(self, model, **hints):
>> if model._meta.app_label == 'redford':
>>   return 'redford_db'
>> return False
>>
>> def allow_relation(self, obj1, obj2, **hints):
>> if obj1._meta.app_label == 'redford' or obj2._meta.app_label ==
>> 'auth':
>> return True
>> return None
>>
>> def allow_migrate(self, db, app_label, model_name=None, **hints):
>>
>> if db == 'default' or app_label in self.route_app_labels:
>> print(db, app_label)
>> return None
>> elif db == 'redford_db':
>> if app_label == 'redford':
>> return True
>> return False
>> return None
>>
>>
>> The code for the models is as below :
>>
>>
>> class Employer(models.Model):
>>  emp_Name = models.OneToOneField(User, on_delete=models.CASCADE,
>>  null=True)
>>  emp_Company = models.CharField(max_length=100)
>>  emp_Address = models.CharField(max_length=500)
>>  emp_Tel = models.CharField(max_length=100)
>>  emp_JobTitle = models.CharField(max_length=200, null=True)
>>  emp_JobDesc = models.CharField(max_length=600, null=False)
>>
>>  def __str__(self):
>>  return self.emp_Name
>>
>>
>> Hope we can work it out
>>
>>
>> regards
>>
>>
>> [image: --]
>>
>> Maninder Kumar
>> [image: http://]about.me/maninder.s.kumar
>> 
>>
>>
>>
>

Re: Ui/Ux to Django

2020-02-23 Thread maninder singh Kumar
How about the following list :
1. HTML 5
HTML 5 is about where most templates would require you to be on.  A
basic idea of forms, buttons and other tags will help
2. CSS 4 preferably bootstrap
This is one of the most important things for UI and will require more
than workable knowledge
3. Javascript coding
javascript is an essential too.
4.  Django templating engine

regards




[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Sun, Feb 23, 2020 at 4:31 AM nawal benmohamed <
nawoulabenmoham...@gmail.com> wrote:

> *how to work with Ui/Ux to Django plz i need help *
>
> --
> 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/f69fe9f6-2119-4e44-b919-852665b7fb66%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/CABOHK3QKF_fCEoQ%2B1s14FmZejKR8QjwOv5GNEjiCVp0oH5CrbQ%40mail.gmail.com.


Re: Bulk SMS website using django

2020-02-23 Thread maninder singh Kumar
We could work out the website.


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Fri, Feb 21, 2020 at 1:22 PM Isaac Imafidon 
wrote:

> I have a project to develop a bulk sms website using django, but i have
> not develop this kind of website before. Also the client want to be able to
> have users that log in and buy credit that they will use to send sms to any
> part of the world. Also i don't know any recommended company to buy the
> reseller at an affordable price that will make my client be able to make
> profit from he's business. I really need you guys support on this, also if
> anyone have develop this kind of website before and just brief me on how to
> go about 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/1707833a-44c2-43f9-8f66-c7fca1a2540d%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/CABOHK3QPuW5dOBohTzWFC-zTU%3DERAp-Y3aigDaraEM%3DWU7Ub2Q%40mail.gmail.com.


Re: get_FOO_display not working ?

2020-02-23 Thread Yves de Champlain
Hi

Actually, the human readable value is not (‘Draft’) but _(‘Draft’) which is 
shorthand for gettext_lazy(‘Draft’)

Yves


> Le 22 févr. 2020 à 23:54, Nde Nguti  a écrit :
> 
> CHOICES =(('draft', 'Draft'), )
> 
> On Sun, Feb 23, 2020, 05:48 Yves de Champlain  > wrote:
> Hi
> 
> I'm using StatusModel from models_utils :
> 
> class MetaData(TimeStampedModel, StatusModel, SoftDeletableModel):
> STATUS = Choices(('draft', _('Draft')),
>  ('submitted', _('Submitted')),
>  ('underreview', _('Underreview')),
>   )
> 
> Forms using STATUS work as expected, but when I load an object from the DB, I 
> can't access the human readable data in my templates.
> 
> a.status => draft
> a.get_status_display => draft
> 
> instead of
> 
> a.status => draft
> a.get_status_display => Draft
> 
> Thanks for any hep on this !
> 
> -- 
> 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/d7a06913-39a8-4e55-9799-ebc46cb5cde4%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/CALfkE84BbTc47u0TGL_PWYNXpoXjs0rsZUG4rjSBNySd8SLGyw%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/C1C43B13-5D76-4C44-9979-F6D9E12D5F6F%40gmail.com.


Re: get_FOO_display not working ?

2020-02-23 Thread Yves de Champlain
Hi

I’ll know if it is much help if it solves my problem. I’ll have a look into 
that.

Thanks !

yves


> Le 23 févr. 2020 à 02:32, Mike Dewhirst  a écrit :
> 
> Maybe the choices should be
> 
> STATUS = [
> ('draft', _('Draft')),
> ...
> ]
> 
> I think the migration system might detect a change in the model every time it 
> is run because the get_text_lazy() function can return a non-static result. 
> Not sure about that.
> 
> I haven't used _() myself but I have used methods to fill up choices lists 
> with just that outcome. I had to finalize the list prior to running migrate.
> 
> Not much help I know
> 
> Good luck
> 
> Mike
> 
>  Original message 
> From: Yves de Champlain 
> Date: 23/2/20 15:47 (GMT+10:00)
> To: Django users 
> Subject: get_FOO_display not working ?
> 
> Hi
> 
> I'm using StatusModel from models_utils :
> 
> class MetaData(TimeStampedModel, StatusModel, SoftDeletableModel):
> STATUS = Choices(('draft', _('Draft')),
>  ('submitted', _('Submitted')),
>  ('underreview', _('Underreview')),
>   )
> 
> Forms using STATUS work as expected, but when I load an object from the DB, I 
> can't access the human readable data in my templates.
> 
> a.status => draft
> a.get_status_display => draft
> 
> instead of
> 
> a.status => draft
> a.get_status_display => Draft
> 
> Thanks for any hep on this !
> 
> -- 
> 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/d7a06913-39a8-4e55-9799-ebc46cb5cde4%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/5e522a9f.1c69fb81.cae91.b7f5SMTPIN_ADDED_MISSING%40gmr-mx.google.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/377B8ADD-1C7A-4418-BA76-3A12C325DC44%40gmail.com.


Re: Selecting all and posting

2020-02-23 Thread Rishabh Gupta
I can help give me checkout . You need to use of javascript .You can
take id from input field and place in value

On Sun, Feb 23, 2020 at 9:12 PM Isaac Ndutumo  wrote:
>
> Am working on a hospital system where the billing model requires users to 
> select varies items from the bill list and post them by creating a receipt or 
> an invoice. Am new in JavaScript programming combined with Django.
>
> Any help on below tasks will be highly appreciated
>
> Select all or few and post either as a receipt or invoice.
> Show total of selected items dynamically
>
>
>   Find attached capture for bill view.
>
> --
> 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/1b59fa26-910c-4fb6-81c4-a7b38291abf7%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/CACpDem3efVDbusZHhJGWvLh_F1epgK4nEO2hNxe5%2BdnO5ObJDw%40mail.gmail.com.


Re: Struggling on how to divide our ERP according to the Compary regional offices may someone help.

2020-02-23 Thread Ishwor Khanal
Here is the deal, go for semi isolation approach that is separate schema
for each tenant and public schema for global database (tenant information,
reports or any other table) it is quite easy to maintain and scale as well.
If you would like to dive into depth follow micro architecture pattern i.e.
db per app means if you have HR module in your system create one app named
app_hr and db_app_hr, further down follow the semi-isolation schema
approach in each app as well.
Ask me anything you would like to discuss in detail. Happy to discuss about
architecture as we have been working one heavy educational project based on
multi-tenant SAAS using python, python-jango, python-django tenant-schema,
postgres.

Thank you

Regards
Ishwor

On Sun, Feb 23, 2020 at 10:28 PM dumbaclassics 
wrote:

>
> Hello Family.
>
> We have been developing in django for 2years now. Our company recently
> migrated from a manual system to an ERP and we opted for Django. We have a
> nice working ERP  with accounting, inventory, hr, crm and scheduling
> modules.
>
>
> The problem is that the Company has got regional branches and now they
> would want us to come with a solution where the Head Office has access to
> summary data an all its branches, branches managing their own affairs
> without them stumbling on one another. We have been researching on
> solutions and django_tenants did come up when it comes to seperation of
> databases by schemas but still we dont see how then the Company head office
> can have an overall access to its branches at the same time offer service
> based on utilising the System Modules.
>
> Any suggestion would be much appreciated
>
>
> Thanks
>
>
> Sent from my Samsung Galaxy smartphone.
>
> --
> 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/i80aomak4baf6ivi8choq8xy.1582455839916%40email.android.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/CAPKFhaqP8v7jKwBxkVAmGq6r1k3joieZ8jw6E_iRXYWv0gG0oQ%40mail.gmail.com.


Re: Django - CreateView not saving form with nested formset

2020-02-23 Thread bnmng
One thing you can try for troubleshooting is an else clause to go with your 
is_valid

if education.is_valid():
education.save(commit=False)
education.instance = self.object
education.save()
else:
print('There was an error')
for err in education.errors:
  print(err)


On Sunday, February 23, 2020 at 2:01:37 AM UTC-5, Shazia Nusrat wrote:
>
> Hi,
>
> Can someone help to answer the question in link?
> Also I've been trying to get CreateView working with 5 inline formsets but 
> couldn't make it work. 
>
> Will really appreciate your help if someone can help me with working 
> example.
>
> Question: 
> https://stackoverflow.com/questions/60354976/django-createview-not-saving-form-with-nested-formset
>
> Regards,
>
> Shazia
>

-- 
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/86c26d31-485c-4e80-8c82-18eb4b602deb%40googlegroups.com.


ANN: django-yamlconf v1.2.0 is available

2020-02-23 Thread Michael Rohan
 Hi Folks,

Have release v1.2.0 for django-yamlconf, a module supporting Django
settings via YAML files (searching up the directory hierarchy, e.g., in a
K8s environment, adding a "final" set of settings via "/APPLICATION.yaml",
see the documentation a https://django-yamlconf.readthedocs.io/en/latest/
for more detailed info.

The updates for the this release are:

- Tagged with ``v1.2.0``.
- Updates to support Django 3.0: Simply use "`six`" instead of the
  support "`django.utils.six`" package and use "`render`" instead of
  "`render_to_response`".
- `ycsysfiles` should generate executable files if the source template
  file is executable.
- Ensure the absolute path is used when searching for YAML control
  files.  This issue is seen when running Django apps under uWSGI
  control.
- Added the built-in attribute ``CPU_COUNT`` (primarily for use in uWSGI
  ini files) giving the number of available CPUs.

Take care,
Michael.

-- 
Michael Rohan
mro...@acm.org

-- 
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/CAOCsNFhTf1Ar3paJ-3tJdVVZ1qO%2B-FWEzDOkiDtQwOBHJwiKRw%40mail.gmail.com.


Re: ANN: django-yamlconf v1.2.0 is available

2020-02-23 Thread maninder singh Kumar
Thanks for the info.


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Mon, Feb 24, 2020 at 7:27 AM Michael Rohan  wrote:

> Hi Folks,
>
> Have release v1.2.0 for django-yamlconf, a module supporting Django
> settings via YAML files (searching up the directory hierarchy, e.g., in a
> K8s environment, adding a "final" set of settings via "/APPLICATION.yaml",
> see the documentation a https://django-yamlconf.readthedocs.io/en/latest/
> for more detailed info.
>
> The updates for the this release are:
>
> - Tagged with ``v1.2.0``.
> - Updates to support Django 3.0: Simply use "`six`" instead of the
>   support "`django.utils.six`" package and use "`render`" instead of
>   "`render_to_response`".
> - `ycsysfiles` should generate executable files if the source template
>   file is executable.
> - Ensure the absolute path is used when searching for YAML control
>   files.  This issue is seen when running Django apps under uWSGI
>   control.
> - Added the built-in attribute ``CPU_COUNT`` (primarily for use in uWSGI
>   ini files) giving the number of available CPUs.
>
> Take care,
> Michael.
>
> --
> Michael Rohan
> mro...@acm.org
>
> --
> 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/CAOCsNFhTf1Ar3paJ-3tJdVVZ1qO%2B-FWEzDOkiDtQwOBHJwiKRw%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/CABOHK3TJWM4t%3DVDzbcQszHTF9tK2Rze3jT-%3DOFypieqxpuy2Hw%40mail.gmail.com.


Re: Django - CreateView not saving form with nested formset

2020-02-23 Thread maninder singh Kumar
Great thought


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Mon, Feb 24, 2020 at 7:00 AM bnmng  wrote:

> One thing you can try for troubleshooting is an else clause to go with
> your is_valid
>
> if education.is_valid():
> education.save(commit=False)
> education.instance = self.object
> education.save()
> else:
> print('There was an error')
> for err in education.errors:
>   print(err)
>
>
> On Sunday, February 23, 2020 at 2:01:37 AM UTC-5, Shazia Nusrat wrote:
>>
>> Hi,
>>
>> Can someone help to answer the question in link?
>> Also I've been trying to get CreateView working with 5 inline formsets
>> but couldn't make it work.
>>
>> Will really appreciate your help if someone can help me with working
>> example.
>>
>> Question:
>> https://stackoverflow.com/questions/60354976/django-createview-not-saving-form-with-nested-formset
>>
>> Regards,
>>
>> Shazia
>>
> --
> 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/86c26d31-485c-4e80-8c82-18eb4b602deb%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/CABOHK3RgNPJkQc7Ro3%2BBMNuKzoAnCeXi20wEJUfsuAqhHe85tA%40mail.gmail.com.


Re: Struggling on how to divide our ERP according to the Compary regional offices may someone help.

2020-02-23 Thread maninder singh Kumar
The branch offices could be a separate organization unit


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Sun, Feb 23, 2020 at 4:58 PM dumbaclassics 
wrote:

>
> Hello Family.
>
> We have been developing in django for 2years now. Our company recently
> migrated from a manual system to an ERP and we opted for Django. We have a
> nice working ERP  with accounting, inventory, hr, crm and scheduling
> modules.
>
>
> The problem is that the Company has got regional branches and now they
> would want us to come with a solution where the Head Office has access to
> summary data an all its branches, branches managing their own affairs
> without them stumbling on one another. We have been researching on
> solutions and django_tenants did come up when it comes to seperation of
> databases by schemas but still we dont see how then the Company head office
> can have an overall access to its branches at the same time offer service
> based on utilising the System Modules.
>
> Any suggestion would be much appreciated
>
>
> Thanks
>
>
> Sent from my Samsung Galaxy smartphone.
>
> --
> 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/i80aomak4baf6ivi8choq8xy.1582455839916%40email.android.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/CABOHK3QaX_G-60VwAXTc9Ee_h-ucA%2B6QyY3395TPHbWiq%3Dd37g%40mail.gmail.com.


Re: Selecting all and posting

2020-02-23 Thread maninder singh Kumar
There is a doubt about the model


[image: --]

Maninder Kumar
[image: http://]about.me/maninder.s.kumar





On Mon, Feb 24, 2020 at 4:37 AM Rishabh Gupta 
wrote:

> I can help give me checkout . You need to use of javascript .You can
> take id from input field and place in value
>
> On Sun, Feb 23, 2020 at 9:12 PM Isaac Ndutumo 
> wrote:
> >
> > Am working on a hospital system where the billing model requires users
> to select varies items from the bill list and post them by creating a
> receipt or an invoice. Am new in JavaScript programming combined with
> Django.
> >
> > Any help on below tasks will be highly appreciated
> >
> > Select all or few and post either as a receipt or invoice.
> > Show total of selected items dynamically
> >
> >
> >   Find attached capture for bill view.
> >
> > --
> > 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/1b59fa26-910c-4fb6-81c4-a7b38291abf7%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/CACpDem3efVDbusZHhJGWvLh_F1epgK4nEO2hNxe5%2BdnO5ObJDw%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/CABOHK3R71Jjz6TyB566ExsuA7bNk0FBEcYLf0vMoFuNV8TZwag%40mail.gmail.com.


Re: Django i18n_patterns default language

2020-02-23 Thread Szocs Arnold
Is there any solution to add language prefix to the URL from the
settings.LANGUAGE_CODE which is my preferred language. Instead from
 "Accept-Language" header. I do not want to use the browser language.

On Fri, Feb 21, 2020 at 4:14 PM Aldian Fazrihady  wrote:

> A web browser has language preference setting. When a request made to your
> Django server,  your browser reads its language preferences and it put it
> in the request "Accept-Language" header.
> Django will check if the request URL has language prefix in it. If it
> doesn't it will add language prefix to the same URL and make web browser to
> redirect to that new URL.
>
> You can see the flow using web browser developer tool.
>
> On Fri, Feb 21, 2020 at 8:43 PM Szocs Arnold 
> wrote:
>
>> I am using i18n_patterns to change the language prefix in url. It s
>> working fine ones the language cookie is set. The problem is that it's
>> adding /en/ when I trying to access a page without the language code in
>> private window, even though my preferred language is not en (the default
>> one set in settings.LANGUAGE_CODE). The Django documentation says that how
>> django discovers language prefference:
>>
>> Django documentation says it will use the following to choose the
>> language:
>>
>> First, it looks for the language prefix in the requested URL.Failing
>>> that, it looks for the LANGUAGE_SESSION_KEY key in the current user’s
>>> session.Failing that, it looks for a cookie. The name of the cookie used is
>>> set by the LANGUAGE_COOKIE_NAME setting. (The default name is
>>> django_language.) Failing that, it looks at the Accept-Language HTTP
>>> header. This header is sent by your browser and tells the server which
>>> language(s) you prefer, in order by priority. Django tries each language in
>>> the header until it finds one with available translations. Failing that, it
>>> uses the global LANGUAGE_CODE setting.
>>>
>>
>> So the reason why I get /en/ prefix in my url, when there is no any
>> cookie set is because of the Accept-Language HTTP header. How can i solve
>> that if somebody visits my site for the first time when there is no cookie,
>> the i18n to go to the final step to get the language from the global
>> LANGUAGE_CODE?
>>
>>
>> --
>> 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/5586da94-87bb-4879-b227-f8e29ce3e635%40googlegroups.com
>> 
>> .
>>
>
>
> --
> Regards,
>
> Aldian Fazrihady
> http://aldianfazrihady.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/CAN7EoAbU5kUTc0UrX0etqp_s8bC4zK0L-wHpYNuoUB585DM7Og%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/CABRfZM%2BbayBueLk68gC8NiQhrkisG8G%2B_OktDdOr9uR%3DW2yk_w%40mail.gmail.com.