My django model joining wrong fields when there are multiple related fields with join

2018-09-19 Thread Sadaf Noor
My product model has two different relationship with category model: 1. One to One 2. One to Many through ProductShadowCategory table. Now the situation is when I tried to fetch using the second relationship, I am getting the result from my first relationship. For example this is what I

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread nelson fernando garcia gomez
to have a select field with 2000 records I want it to be only reading to show me the field to which is linked only reading if I put it in disabled mode I deactivate the ok field to this point well, the bad thing is that putting it this way, the 2000 records are still loaded into the template

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread nelson fernando garcia gomez
a possible solution I see is to change the field to CharField() type, here is a new problem: the field is printed the pk that is related as then how can I read that pk to show the name and not that pk in the template? El martes, 18 de septiembre de 2018, 13:58:26 (UTC-5), nelson fernando

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread nelson fernando garcia gomez
to have a select field with 2000 records I want it to be only reading to show me the field to which is linked only reading if I put it in disabled mode I deactivate the ok field to this point well, the bad thing is that putting it this way, the 2000 records are still loaded into the template

Re: Not able to connect mongo DB with django2.1

2018-09-19 Thread Alfredo Sumague
The latest django version you can use for mongodb is 1.6 Flask another framework you use instead of Django, and it support mongodb. On Mon, Sep 17, 2018 at 4:16 AM akshat ahuja wrote: > Hey guys, > I am a beginner to Django and I am making an application in which I have > to connect to MongoDB

Re: Creating urls

2018-09-19 Thread Mateusz
Your problem is caused by not properly structurizing your url files. An example (just for reference) is shown below: */myappointments/urls.py* # includes... urlpatterns = [ path('admin/', admin.site.urls), path('', include('clinic.urls'), namespace='clinic'), # for example.com/ where

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread Mateusz
Sorry but I don't understand. For me, what you say now is that you want the field to be visible but empty (without any data from model in it) or invisible (excluded)? Can you, please, clarify what do you want to achieve? Have you tried appending the lines I gave you, not replacing the last line?

Re: django-filter over models

2018-09-19 Thread brajesh kumar
I think this answers my question , trying to implement it. On Wednesday, September 19, 2018 at 4:45:02 AM UTC+5:30, Mateusz wrote: > > In that answer I assume Jobs are connected anyhow with Persons with a > ForeignKey field like so: > > *File /appname/models.py:* > > from django.db import models

I am looking for a view that talks to two models and same two models managed in admin page / html

2018-09-19 Thread brajesh kumar
Reference : https://www.youtube.com/watch?v=6lafzyjiqgQ -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to

Re: Chaining Q objects

2018-09-19 Thread Simon Charette
Hey Mike, Please provide the full traceback. Also, since all your conditions are ANDed you could use a dict to build filter() kwargs instead of Q() objects. Cheers, Simon Le mercredi 19 septembre 2018 10:36:13 UTC-4, Matthew Pava a écrit : > > I’m not entirely sure if the error is from your Q

RE: Chaining Q objects

2018-09-19 Thread Matthew Pava
I’m not entirely sure if the error is from your Q chain, but something I would try is to replace “[:1].get()” with “.first()”. wm = Boat.objects.filter(name=x).filter( f ).first() From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of MikeKJ Sent: Wednesday,

Chaining Q objects

2018-09-19 Thread MikeKJ
Using this as an example from Dan Herrar enter code here from django.db.models import Q user_pk = 1 category_pk = 1 #some times None f = Q( user__pk = user_pk, date=now() ) if category_pk is not None: f &= Q( category__pk = category_pk )

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread nelson fernando garcia gomez
This only disables it but internally it receives data this makes the process of loading the template is the same with disabled enabled or disabled, so it is necessary to use readonly but does not show readonly. El martes, 18 de septiembre de 2018, 19:00:37 (UTC-5), Mateusz escribió: > > (use

Re: Readonly ModelChoiceField of type in model foreignkey

2018-09-19 Thread nelson fernando garcia gomez
This only disables it but internally it receives data this makes the process of loading the template is the same with disabled enabled or disabled, so it is necessary to use readonly but does not show readonly. El martes, 18 de septiembre de 2018, 19:00:37 (UTC-5), Mateusz escribió: > > (use

Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Andréas Kühne
This is not possible with the mysql database, as mysql doesn't support schemas. Schemas in mysql creates multiple databases - this means that you will have to create a new database for each client. Postgres is a much better solution for these types of things. Regards, Andréas Den ons 19 sep.

Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Sep 19, 2018 at 12:09:20AM -0700, Devender Kumar wrote: > Hi, > I need a help from you I wanna start a project which is a multitenant > application and I want the tenant can register themselves and schema is > created for him from the

Re: How to save multiple model form in one template?

2018-09-19 Thread Sunil Kothiyal
HI Everett White , Please suggest solution i am trying since 3 days, I want Django model update if exist. I will very thankful to you. -- 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

Re: How to save multiple model form in one template?

2018-09-19 Thread Everett White
Hey y’all -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to

Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Joel
Follow the django tutorial. Once you complete part 2, you can easily start writing. https://docs.djangoproject.com/en/2.0/intro/tutorial01/ You don't have to worry too much about schema as you use models. On Wed 19 Sep, 2018, 12:39 PM Devender Kumar, wrote: > Hi, > I need a help from you I

Re: Not able to connect mongo DB with django2.1

2018-09-19 Thread Benjamin SOULAS
Hi Akshat, Could you be more specific? Do you have some code to provide to us in order to help you? Do you have errors? Pymongo is a good lib if you intend not to use the Django ORM, if you want to use the ORM, Djongo exists, or others ODMs Kind regards, Benjamin -- You received this

Re: Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Devender Kumar
All this should be done using the MySQL database. On Wednesday, September 19, 2018 at 12:39:20 PM UTC+5:30, Devender Kumar wrote: > > Hi, > I need a help from you I wanna start a project which is a multitenant > application and I want the tenant can register themselves and schema is > created

Refer tutorials to make multitenant application with shared database with multiple schma

2018-09-19 Thread Devender Kumar
Hi, I need a help from you I wanna start a project which is a multitenant application and I want the tenant can register themselves and schema is created for him from the shared database across tenants. I want to make this application in Django I know all the terminology of how multitenancy can