Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
When I inspect the object in Firefox that is what it looks like because it is generated by Django. Does the user have to select an item and then submit it in order for me to get the ID? Thanks. On Friday, 15 June, 2018 10:29 PM, C. Kirby wrote: So you have a | A |B |||C || | If you make

Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
The ID is an integer as it is the ID for the table. The name is a VARCHAR. I have had this same problem in the past with other programming languages.  How to get my head around how to get the ID for a selected item. On Friday, 15 June, 2018 10:09 PM, Anthony Anonde wrote: Sorry your

Django Admin: multi-table inheritance child model with many-to-many through inline fails with “Please correct the error below”

2018-06-15 Thread Scott Obara
I'm not sure if this is a bug, limitation or error on my part, but I would like to get feedback on if there is a solution or work around to this issue... In Django Admin, I have created a many-to-many inline based on a 'through' model `ReleaseCardCount`. The inline is linked to a parent class

Re: 404 error on tried these URL patterns, in this order: ^polls/ ^admin/

2018-06-15 Thread C. Kirby
What it the url you tried to access? On Friday, June 15, 2018 at 10:41:41 AM UTC-4, emmanuel wyckens wrote: > > Hello > > I didn't find my 404 error, it's seems that the issue is arround the urls > configuration on the project. In additionnal, find the zip project for more > details. > Confg :

[Mixins] - Order of the Mixins - Is it a bug?

2018-06-15 Thread Vinnicyus Gracindo
Hi. I beat my brains out trying to find out why my cbv was not working with LoginRequiredMixin. I found the order of the mixins in the inheritance: It works: class UserListView(LoginRequiredMixin, ListView) Doesn't work: class UserListView(ListView, LoginRequiredMixin) Is that how it was

404 error on tried these URL patterns, in this order: ^polls/ ^admin/

2018-06-15 Thread emmanuel wyckens
Hello I didn't find my 404 error, it's seems that the issue is arround the urls configuration on the project. In additionnal, find the zip project for more details. Confg : django 1.11.11, python 2.7 Please could you help me ? Thanks In urls.py from django.conf.urls import url, include

Re: Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread prateek gupta
Thanks, I will verify. On Friday, June 15, 2018 at 7:55:10 PM UTC+5:30, Andréas Kühne wrote: > > As Jason stated you probably have an issue with security groups. Make sure > that your EC2 instance is in a security group that can access the mysql > server. Otherwise you won't be able to connect.

Re: Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread prateek gupta
Thanks Json, I will check this. On Friday, June 15, 2018 at 6:41:42 PM UTC+5:30, Jason wrote: > > have you checked your security settings in the aws console to make sure > the port is open? > > also have you seen https://stackoverflow.com/a/45792248/214892 > -- You received this message

Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread C. Kirby
So you have a A B C If you make your option tags look like {{person.name}} The submitted value for the field will be the patient_id, which you then use in your filter statement. On Friday, June 15, 2018 at 8:46:53 AM UTC-4, Gerald Brown wrote: > > Greetings: > > I have a form with a

Re: Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread Andréas Kühne
As Jason stated you probably have an issue with security groups. Make sure that your EC2 instance is in a security group that can access the mysql server. Otherwise you won't be able to connect. And the error you have is what you get when the security groups aren't correct. See here:

Re: how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Anthony Anonde
Sorry your question is a bit complicated, you have a form that contains a list of names and id, what data types are they contain in? Understand how the list box is structured will help to give you a better ans -- You received this message because you are subscribed to the Google Groups

Re: Django Admin verification

2018-06-15 Thread Anthony Anonde
I will suggest to have a field with active set to false, so when the use signs in you cleaned the data send a notice to the admin, mean while the user info is save to the database but user account is not active because the field active is set to false. When the admin sees the user data he can

RE: Nested for loops in templates

2018-06-15 Thread Matthew Pava
I would probably even simplify the code. Apparently, there’s a setting called TEMPLATE_STRING_IF_INVALID def getattribute(value, arg): """Gets an attribute of an object dynamically from a string name""" return getattr(value, arg, settings.TEMPLATE_STRING_IF_INVALID) or

Re: im facing this problem please help me

2018-06-15 Thread Jason
this is a common issue, apparently, with powershell. First result when looking at *django powershell* brought me to https://stackoverflow.com/questions/23439089/using-django-admin-on-windows-powershell -- You received this message because you are subscribed to the Google Groups "Django

Re: Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread Jason
have you checked your security settings in the aws console to make sure the port is open? also have you seen https://stackoverflow.com/a/45792248/214892 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

how to pass the ID of a slected item in a list to ORM

2018-06-15 Thread Gerald Brown
Greetings: I have a form with a listbox that has people's names and their ID from the database. I am trying to get the ID from that list for the selected person so I can use it in ORM statements: I.E. v1 = Visit.objects.filter(person_id = ??) where ?? is the ID from the select list. Has

Re: Django Admin verification

2018-06-15 Thread Daniel Ale
Let's talk more on this project. You still have to add the the data to database, maybe u can create a field to check for verification , there is no way u can persist the data plus an instance of the model will be sent to admin in order to verify it... Good job. On Wed, Jun 13, 2018, 13:13 habib

im facing this problem please help me

2018-06-15 Thread Yashwanth Gathuku
django-admin.py : The term 'django-admin.py' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + django-admin.py startproject mysite +

Getting django.db.utils.OperationalError: (2005, "Unknown MySQL server host error with AWS

2018-06-15 Thread prateek gupta
Hi All, I am trying to connect with AWS and when I run the server I get following error- django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'psdbuat.chmnxeoa2hhd.ap-southeast-1.rds.amazonaws.com' (0)") I checked the connection in mysql workbench and details are fine. My

Re: Nested for loops in templates

2018-06-15 Thread Mikkel Kromann
Thanks Matthew. The field_list is a list strings containnig the field names hardcoded in Models.py by the programmer. I.e. the field names that shoud appear in the Class Based Views. So, perhaps this answers my question to Vijay - that the row in the iteration is in fact the Model object. And

Re: Nested for loops in templates

2018-06-15 Thread Mikkel Kromann
Thank you Vijay. That link seems to be a feasible path for me to take (reproduced below). Perhaps you or others can help me with an additional question (I am a bit new to both Python and Django), that I'm struggling with: Which type of data structure is Django iterating over in the templates

Re: saving django session data for anonymous user

2018-06-15 Thread 'Anthony Flury' via Django users
How are you authenticating them ? Assuming you call :         authenicate( username, password) then before that call - store the sesssion key after that call - identify the new session key with the old and new session keys - now update the database - so that the cart gets associated with