Django 2.2: how to use to a field "from a foreign model", in a CheckConstraint: ?

2019-11-13 Thread Olivier
Hello, Let say I want to enforce a database constraint saying a "book's author age is over 18". As you may guess, books and authors are each described with a Model subclass with a foreign key (in this example each book is written by a single author) linking both. class Author(models.Model):

tengo un problema a la hora de hacer deploying django app to heroku

2019-11-13 Thread jose angel encinas ramos
mas que nada el poblema que tengo es técnico , el detalle es que cuando escribo en la terminal git push heroku master me lanza el siguiente error y no entiendo cual es el error. (webapps) ➜ BuscadorTims git:(master) ✗ git push heroku master Counting objects: 221, done. Delta compression using

RE: Handling blog posts

2019-11-13 Thread Kasper Laudrup
Hi Hedrick, On 13/11/2019 21.40, Hedrick wrote: > Anyone with the good links on how handle news/posts on my Blog App. > Thanks > Unless we have some mind readers on this mailing list, I'm fairly certain no one knows what my "Blog App" is. Maybe share some details and explain what you want to

Handling blog posts

2019-11-13 Thread Hedrick
Anyone with the good links on how handle news/posts on my Blog App. Thanks -- 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

RE:

2019-11-13 Thread Kasper Laudrup
Hi Paras, On 13/11/2019 18.17, Paras Jain wrote: > now i want to generate random password and send it to mail instead of > simple message OK, should be simple enough. Do you have a question or are you just sharing your to-do list? Btw. of course you don't want these passwords that you want to

Migrating MySQL Maria database to Postgres

2019-11-13 Thread Ram
Hi, We are running a Django development server with MySQL Maria database and we are planning to migrate the database to postgres for the same development server. Please let me know if 'pgLoader' would help in this case or any other option could help? thanks, ~Ram -- You received this message

Re: reg: Django forms and models

2019-11-13 Thread 'Amitesh Sahay' via Django users
Initially I had written the "else" statement at the wrong place. Moved it under the very first "if" and used then returned the HTTPresponse on the right place inside the function Regards, Amitesh S On Wednesday, 13 November, 2019, 5:42:57 AM IST, o1bigtenor wrote: On Tue, Nov

django + bootstrap wizard

2019-11-13 Thread dandu sreenivasulu
Hi All, can someone please suggest any link or tutorial for django with bootstrap wizards. Thanks in advance. Regards, sreenivas -- 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

[no subject]

2019-11-13 Thread Paras Jain
now i want to generate random password and send it to mail instead of simple message views.py: from django.shortcuts import render from profilestorer.settings import EMAIL_HOST_USER from . import forms from django.core.mail import send_mail # Create your views here. def login(request): form

RE: Problem withLogin in Django

2019-11-13 Thread Kasper Laudrup
Hi Saikiran, On 13/11/2019 15.07, IT Technology bySaikiran wrote: > > # Create your models here. > class register(models.Model): > username=models.CharField(max_length=100) > password=models.CharField(max_length=100) > email=models.CharField(max_length=100) >

RE: Problem withLogin in Django

2019-11-13 Thread Kasper Laudrup
"IT Technology bySaikiran" – 13. november 2019 15:41 > Views.py:=def login(request): > if request.method == 'POST': > username = request.POST['username'] > password = request.POST['Password1'] > for i in register.objects.all(): > print('db Value'+i.username) > if

revert back to django in virtual environment from local fork

2019-11-13 Thread Durai pandian
Hello All, I followed the contribution guide to point out local forked django in the new virtual environment. https://docs.djangoproject.com/en/2.2/intro/contributing/#intro-contributing-install-local-copy However my all other virtual environments are pointing to the local fork instead of the

Re: Performing a query returns an error

2019-11-13 Thread Patrick Carra
Simon thank you for that I had been playing around with db_column but did not realize the exact reference I should have been making. Thank you for the quick reply! On Wednesday, November 13, 2019 at 9:46:59 AM UTC-6, Simon Charette wrote: > > Hello Patrick, > > From what I understand you are

Re: Performing a query returns an error

2019-11-13 Thread Simon Charette
Hello Patrick, >From what I understand you are relying on unmanaged (Meta.managed=False) models to use the ORM to query an externally managed database. The part you missed here is that the ORM maps ForeignKey fields to database columns with a "_id" suffix by default. In your case that means it

Performing a query returns an error

2019-11-13 Thread Patrick Carra
Hello all I am new to django and I am trying to do a query to that will provide me with information from multiple tables I have included my models.py file below: Enter code hclass Circuitinfotable(models.Model): pid = models.CharField(max_length=255, blank=True, null=True) circuitid =

Problem withLogin in Django

2019-11-13 Thread IT Technology bySaikiran
Views.py: = def login(request): if request.method == 'POST': username = request.POST['username'] password = request.POST['Password1'] for i in register.objects.all(): print('db Value'+i.username) if i.username == 'saikiran_maddipatla'

Re: Django 2.2 CheckContraint: how to check "min_foo < max_foo" ? [SOLVED]

2019-11-13 Thread Olivier
Yes, using things like models.F('price') made it ! Thank you very much, Leonardo, for this. Le mercredi 13 novembre 2019 13:35:37 UTC+1, LRezende a écrit : > > Hi, >Didn't tested... Did you try the F expression? > > from django.db import models > class Customer(models.Model): > age =

Django Tests (--parallel) flag issues

2019-11-13 Thread Oscar Chacon
I've been working on trying to set up my tests to run in parallel, however I've experienced some issues along the way. I've tried setting the parallel flag in the options for the django tests, and while it creates the copies of the db, it only creates the main thread and runs all my tests

Re: Django 2.2 CheckContraint: how to check "min_foo < max_foo" ?

2019-11-13 Thread Leonardo Rezende
Hi, Didn't tested... Did you try the F expression? from django.db import models class Customer(models.Model): age = models.IntegerField() class Meta: constraints = [ models.CheckConstraint(check=models.Q(discounted_price__lte=models.F('price')),

Re:

2019-11-13 Thread Paras Jain
thanks u so so so much bro i have done such a silly mistake .Really appreciated On Wed, Nov 13, 2019 at 5:11 PM Vivek Jha wrote: > Go to admin.py and import the model and then > > > admin.site.register(modelname) > > Save and refresh it > > On Wed 13 Nov, 2019, 5:08 PM Nitin Kalmaste, >

Re:

2019-11-13 Thread Vivek Jha
Go to admin.py and import the model and then admin.site.register(modelname) Save and refresh it On Wed 13 Nov, 2019, 5:08 PM Nitin Kalmaste, wrote: > if your migrations are successful run queries through manage.py shell > There is existing User model inside django.contrb.auth.User > > On

Re:

2019-11-13 Thread Nitin Kalmaste
if your migrations are successful run queries through manage.py shell There is existing User model inside django.contrb.auth.User On Wed, Nov 13, 2019 at 3:49 PM Paras Jain wrote: > i have just created a model which will have login information in database > but it is not showing its appearance

Re: djangorestframework vs GraphQL

2019-11-13 Thread DANIEL URBANO DE LA RUA
You have a good example on saleor eccomerce is on github On Wed, 13 Nov 2019, 09:15 guettli, wrote: > I never used GraphQL, but I like it. In the past the django web framework > had a different API than a restframework for ruby or Nodejs. > > With GraphQL you have a well defined API and

[no subject]

2019-11-13 Thread Paras Jain
i have just created a model which will have login information in database but it is not showing its appearance i have also done migration models.py: from django.db import models # Create your models here. class User(models.Model): email = models.EmailField() password =

How to get the name and extension of a filename using environ, not os

2019-11-13 Thread Richard Balwane
Hello, I am importing environ as opposed to os and want to split the filename to get its name and extension. Please help. *Richard Dick Balwane* *Mobiles:+256 755 442248, * *+256 781 493558.* *Twiter: @RBalwane* *WhatsApp: **+256 755 442248*

Re: djangorestframework vs GraphQL

2019-11-13 Thread guettli
I never used GraphQL, but I like it. In the past the django web framework had a different API than a restframework for ruby or Nodejs. With GraphQL you have a well defined API and changeing the backend part should be easier. But again, I never used it up to now. Am Dienstag, 12. November 2019