Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel Mathew
Yes, thank you, Todor. Yesterday night, I ended up doing exactly this. Sincerely yours, Joel G Mathew On Wed, 28 Nov 2018 at 12:46, Todor Velichkov wrote: > Right now, your doctor will be deleted if its ProfilePicture gets deleted. > I'm pretty sure you don't want to do that. > I believe thi

Re: Unexpected behavior on delete of model

2018-11-27 Thread Todor Velichkov
Right now, your doctor will be deleted if its ProfilePicture gets deleted. I'm pretty sure you don't want to do that. I believe this is what you are looking for: class Doctor(models.Model): # When the profile picture gets delete, clear doctors profile picture (set to NULL) pr

why created_at is greater than updated_at while inserting data in table

2018-11-27 Thread Ankit Khandewal
hello, i am using this code to update created_at and updated_at in models: created_at = models.DateTimeField(auto_now_add=True) updated_at= models.DateTimeField(auto_now=True,null=True) but however there is created _at is greater than updated_at when data is inserted: created_at

forms.FORM in django

2018-11-27 Thread shiva kumar
I am new to django and i am learning it slowly. I worked on forms but i have one doubt, what forms.FORM indicate. i know we are inheriting forms in to our class but i dont understand specifically what it is. how FORM will be used could anyone please explain what it is -- You received this me

Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
Ignore the last post. Formatting blues in my main editor. On Wed, 28 Nov, 2018, 11:34 AM Joel I think you made a typo in the code. doctor can't be a Foreign key for > class Doctor. Anyway I get your point, and this is the same way I solved it > yesterday. > > On Wed, 28 Nov, 2018, 11:07 AM Saurab

Re: Unexpected behavior on delete of model

2018-11-27 Thread Joel
I think you made a typo in the code. doctor can't be a Foreign key for class Doctor. Anyway I get your point, and this is the same way I solved it yesterday. On Wed, 28 Nov, 2018, 11:07 AM Saurabh Agrawal >> >> >> class Doctor(models.Model): >> >> name = models.CharField(max_length=35

Re: Easiest front end JavaScript framework to integrate with a Djangobackend?

2018-11-27 Thread Andréas Kühne
I think this is more of a preference for yourself. I am using Angular with our Django Rest Framework backend. Which is a nice choice for our current purpose. Vue.js is also a good choice if you only want a simple frontend with only certain functionality. Of course another choice could be React.

Re: Unexpected behavior on delete of model

2018-11-27 Thread Saurabh Agrawal
> > > > > class Doctor(models.Model): > > name = models.CharField(max_length=35) > > username = models.CharField(max_length=15) > > > > class DoctorProfilePic (models.Model): > > name = models.CharField(max_length=255, blank=True) > > pic = StdImageField(uplo

RE: Easiest front end JavaScript framework to integrate with a Djangobackend?

2018-11-27 Thread Sir Robert James Patterson
What Alfred said . . . . .and than some 😉 https://django-angular.readthedocs.io/en/latest/ Sent from Mail for Windows 10 From: Alfredo Sumague Sent: Tuesday, November 27, 2018 8:13 PM To: django-users@googlegroups.com Subject: Re: Easiest front end JavaScript framework to integrate with a Dj

Re: Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-27 Thread Alfredo Sumague
you can use AngularJS framework with Django. goodluck, Alfred On Tue, Nov 27, 2018 at 12:21 PM Simon Connah wrote: > I'm in the process of building a website in Django and need to make a > specific part of my application dynamic. Because of that I'd like to use > a JavaScript frontend framework

Retrieving Records from oauth2_provider_grant table in Django Oauth Toolkit

2018-11-27 Thread Asad Habib
How do I retrieve records from the oauth2_provider_grant table? Does Django Oauth Toolkit provide the functionality to do this? Thanks in advance. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: Channels: development issue with multiple daphne workers

2018-11-27 Thread Zhiyu/Drew Li
Thanks Andrew, I tried removing "--fd 0" but it didnt work. I got 504 time out error no matter numprocs=1 or 4. Do you know are there any open-source projects that use channel2? I just want to take a look at their repos as my examples. Thanks Drew On Tuesday, November 27, 2018 at 10:26:16

Easiest front end JavaScript framework to integrate with a Django backend?

2018-11-27 Thread Simon Connah
I'm in the process of building a website in Django and need to make a specific part of my application dynamic. Because of that I'd like to use a JavaScript frontend framework to build this portion of the site. I was wondering if anyone had any recommendations for which JavaScript framework I s

RE: Unexpected behavior on delete of model

2018-11-27 Thread Matthew Pava
You’ll want to review this reference: https://docs.djangoproject.com/en/2.1/ref/models/fields/#django.db.models.ForeignKey.on_delete You probably want the option on doc to be SET_NULL. Actually, I suggest some overall cleanup. Your model names should follow a standard convention. Django practice

Unexpected behavior on delete of model

2018-11-27 Thread Joel Mathew
Situation: I have two Model classes, in two different apps which are part of the same project. class doctor defined in appointments.models is a set of attributes associated with a doctor, like name, username, email, phone etc. class DoctorProfilePic is a Model defined in clinic.models, which has a

Re: Channels: development issue with multiple daphne workers

2018-11-27 Thread Andrew Godwin
I'm not sure why you're getting the _UnixSelectorEventLoop - that sounds like a Twisted error you should search around for, and make sure you have the right package versions. --fd 0 should not be needed in that command line, since you're already passing the UNIX socket, I don't remember why it's

Re: runserver error rectification

2018-11-27 Thread shiva kumar
import polls in mysite/mysite/urls.py i think it will work On Tue, Nov 27, 2018 at 3:00 PM Sanjay Malviya wrote: > What modification to codes required, pls in project > mysite/mysite/polls(app) > polls/views.py > from django.http import httpresponse > def index(request): > return httprespo

Re: Recommend Tutorials

2018-11-27 Thread Tim Johnson
* Phako Perez <13.phak...@gmail.com> [181126 19:29]: > What I can recommend to you for this, is to use same versions for each module > on the tutorial so your code will works > > You can create a virtual environment for each tutorial using viertualenv and > as a good practice you can list all mo

RE: get_or_delete leading to duplicate creation

2018-11-27 Thread Matthew Pava
Avoid using the created_at time in your get_or_create call. From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Ankit Khandewal Sent: Tuesday, November 27, 2018 2:01 AM To: Django users Subject: get_or_delete leading to duplicate creation Hello, I am using ge

RE: Human Readable Values

2018-11-27 Thread Matthew Pava
Override the __str__ method. https://docs.djangoproject.com/en/2.1/ref/models/instances/#str From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Mike Sacauskis Sent: Monday, November 26, 2018 5:36 PM To: Django users Subject: Human Readable Values [Screensho

Re: How can I start with django

2018-11-27 Thread Andréas Kühne
Hi, Try the default tutorial: https://docs.djangoproject.com/en/2.1/intro/tutorial01/ Another one that is good is this: https://tutorial.djangogirls.org/en/ Also it could be good to think about a project that you want to implement - could help with your development Happy coding! Regards,

How can I start with django

2018-11-27 Thread Khalid Adam
I like freamework -- 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 django-users@go

Re: Logging a button click

2018-11-27 Thread Nelson Varela
Look good but what is going wrong? Do you see an error or ...? -- 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

Re: Human Readable Values

2018-11-27 Thread Nelson Varela
show your code that renders the values -- 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 ema

Re: help

2018-11-27 Thread Nelson Varela
where is your view and your template in which you show the form and handle the from -- 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...@goo

help

2018-11-27 Thread Tosin Ayoola
Good day guyz trying to create a radio button and checkbox and save it to the database using my models, but it doesn't seems to be working the way i want it, hoping anyone can help me out below is my code. *models.py* class Sports(models.Model): sport = models.CharField(max_length = 150) clas

Re: get_or_delete leading to duplicate creation

2018-11-27 Thread Joel Mathew
You're talking as if this is a bug. If your records are being duplicated, the problem is your code. It's not unto django to gauge what you need to do in the database. Be explicit and update the records if you want updation. Sincerely yours, Joel G Mathew On Tue, 27 Nov 2018 at 18:07, Ankit Kha

Re: get_or_delete leading to duplicate creation

2018-11-27 Thread Andréas Kühne
Hi Ankit, First - this is not the Django developers forum - it's a forum for getting help from other users :-) Second - I don't think this is an error in the underlying framework. get_or_create is used by many people (I use it in several places - especially in tests) - I would recommend that you c

Re: Django doesn't run manage.py: ModuleNotFoundError: No module named 'ProjectName' (clonded Django project))

2018-11-27 Thread Joel Mathew
What I've found helpful in these situations is: As mentioned just above, always use virtual environment to run your project. Include the name of the folder of the virtualenv in .gitignore Use `pip freeze` > requirements.txt Install modules from requirements.txt in each virtualenv Sincerely yours,

Re: Django doesn't run manage.py: ModuleNotFoundError: No module named 'ProjectName' (clonded Django project))

2018-11-27 Thread Daniel M
Hello Marco..activate your virtual environment On Nov 27, 2018 15:37, "Marco Antonio Diaz Valdes" wrote: Hello, my partners and I are working on a Django project using git, a partner begin the project and committed it on github, then the rest of us copy the project on their respective computers,

get_or_delete leading to duplicate creation

2018-11-27 Thread Ankit Khandewal
Hello, I am using get_or_create method in my project and this is leading to creating duplicate for objects, there created_at time difference is in milliseconds, please report this issue to fix. -- You received this message because you are subscribed to the Google Groups "Django users" group.

Django doesn't run manage.py: ModuleNotFoundError: No module named 'ProjectName' (clonded Django project))

2018-11-27 Thread Marco Antonio Diaz Valdes
Hello, my partners and I are working on a Django project using git, a partner begin the project and committed it on github, then the rest of us copy the project on their respective computers, but when we run the "python manage.py runserver" command (or any other command using manage.py) the o

Re: runserver error rectification

2018-11-27 Thread Sanjay Malviya
What modification to codes required, pls in project mysite/mysite/polls(app) polls/views.py from django.http import httpresponse def index(request): return httpresponse('Hello, world, You're at the polls index') polls/urls.py from django.urls import path from . import views urlpatterns = [

Re: Max function and grouping with Oracle

2018-11-27 Thread Simon Charette
Dan, The root of the issue here is that you query is asking to retrieve all fields from the Parent table and perform an aggregation on the JOIN'ed child table. That results in the following query SELECT parent.*, MAX(child.updated_timestamp) FROM parent JOIN child ON (child.parent_id = parent.i