Re: Creating seperate unique ids within the same table

2018-10-17 Thread Joel Mathew
Hi Phako, Thank you. I'm already following this practise. I have the following additional Model: class Checkins(models.Model): checkinno = models.AutoField(primary_key=True, unique=True) hospitalid = models.ForeignKey( customer, on_delete=models.CASCADE, null=True) date = model

Re: Creating seperate unique ids within the same table

2018-10-17 Thread Phako Perez
I suggest to use another table for visit so you can add which doctor, schedule time, and comments or so as a patient may have 1 visit or n... Sent from my iPhone > On Oct 17, 2018, at 9:59 PM, Joel Mathew wrote: > > A hospital id needs to be assigned to a patient and printed on their id card.

Re: Creating seperate unique ids within the same table

2018-10-17 Thread Joel Mathew
A hospital id needs to be assigned to a patient and printed on their id card. When they present their card or this number, their records can be retrieved at any time. A checkin id is additionally generated each day based on the date and time. A patient can have only one patient id but many checkin

help for a Django project

2018-10-17 Thread fatoubinetou196
Hi! I wanted to know if you could frame me on how to design my application of visualizations of the statutes of a payments by the owner with Django. Because it's my first time and I do not quite understand how to list this project in app. -- You received this message because you are subscribed

Re: Need help for sql stored proc

2018-10-17 Thread Gurmeet Kaur
Thank you Matthew for sharing this link with me but my situation is: I have some textboxes whose value I want to pass to sql query and want to do a select *. Right now, I am doing that with the help of queryset but the issue I am facing with this approach is that I need to do multiple ifs and else

Re: Need help in creating responsive web page using Python

2018-10-17 Thread Daniel Veazey
A good place to start is the official tutorials: https://docs.djangoproject.com/en/2.1/intro/ Incorporating Bootstrap is a good way to make your sites responsive: https://getbootstrap.com/ https://www.w3schools.com/bootstrap4/default.asp On Wednesday, October 17, 2018 at 8:04:04 AM UTC-5, Soumya

RE: Creating seperate unique ids within the same table

2018-10-17 Thread Matthew Pava
A number is a number, and we don’t need to attach meaning to it. Why do you need to have continuous ids unique to each clinic? As a developer, I would object to anyone forcing such a requirement. If they insisted, then I would add a property that is calculated each time based on the count of p

RE: Need help for sql stored proc

2018-10-17 Thread Matthew Pava
https://docs.djangoproject.com/en/2.1/topics/db/sql/#calling-stored-procedures From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Gurmeet Kaur Sent: Wednesday, October 17, 2018 11:06 AM To: django-users@googlegroups.com Subject: Need help for sql stored proc

Re: Need help for sql stored proc

2018-10-17 Thread Sudha Mohan
hi friends tell me future of django jobs and salaries with 2+ experience On Wed, Oct 17, 2018 at 9:36 PM Gurmeet Kaur wrote: > > Hi all, > > I have a ms sql stored proc and want to use it. How can I do that? Do I need > to write the class just like a view in models.py? > > Please suggest. > > T

Need help for sql stored proc

2018-10-17 Thread Gurmeet Kaur
Hi all, I have a ms sql stored proc and want to use it. How can I do that? Do I need to write the class just like a view in models.py? Please suggest. Thanks, Gurmeet Kaur -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from th

Creating seperate unique ids within the same table

2018-10-17 Thread Joel Mathew
I have an application which is a clinic management software which allows login into different clinics, and needs to keep patient records of each clinic seperately. The patient records are filed in one common model, with a ForeignKey referring to the clinic to which a patient belongs. Hitherto I ha

Re: Need help in creating responsive web page using Python

2018-10-17 Thread nerdfiles
Try using http://surge.sh with https://foundation.zurb.com/templates.html. On Wednesday, October 17, 2018 at 8:04:04 AM UTC-5, Soumya Mishra wrote: > > I am totally new to development > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Re: Need help in creating responsive web page using Python

2018-10-17 Thread Mikhailo Keda
It's not related to Python, check https://getbootstrap.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 post to

Re: How express SQL query using Django ORM?

2018-10-17 Thread Artem Malyshev
Hi, thanks for the reply! This gives me following query: SELECT "example_price"."category_id", "example_price"."cost" FROM "example_price" GROUP BY "example_price"."id", "example_price"."category_id", "example_price"."from_date", "example_price"."cost",

Why Django don't cache part of the result when the queryset is partly evaluated?

2018-10-17 Thread 胡凯旋
As official document said, the code will query database twice. >>> queryset = Entry.objects.all() >>> print(queryset[5]) # Queries the database >>> print(queryset[5]) # Queries the database again Why don't just

Django Admin get_queryset by sql

2018-10-17 Thread pengheqing
When the data of my Admin list page comes from multiple data sources, the method I can think of is Model.objects.raw(sql), but when I override the get_queryset() method and return this Rawquery, I throw an error: 'RawQuery' object has no attribute 'filter' If I want to implement this function, w

Need help in creating responsive web page using Python

2018-10-17 Thread Soumya Mishra
I am totally new to development -- 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 d

Re: How express SQL query using Django ORM?

2018-10-17 Thread v . kiselicya0210 . work
Price.objects.annotate(_sel=Max('from_date')).filter(from_date=F('_sel')).values("category_id", "price") -- 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

Re: django username and password error

2018-10-17 Thread mottaz hejaze
try this : https://github.com/teddziuba/django-sslserver On Wed, Oct 17, 2018 at 1:14 PM Joel wrote: > Yes, my server did support ssl. But on my local development environment it > doesn't support ssl. > > On Wed, 17 Oct, 2018, 4:41 PM mottaz hejaze, wrote: > >> does your server support SSL ?

Re: Using Primary key in two fields

2018-10-17 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Tue, Oct 16, 2018 at 10:55:48PM -0700, Rakhee Menon wrote: > Hi Everyone, > > I have a scenario where one field needs to be a primary key and another > field needs to be an AutoFieldand Autofield requires a condition > primary_key = true >

Re: django username and password error

2018-10-17 Thread Joel
Yes, my server did support ssl. But on my local development environment it doesn't support ssl. On Wed, 17 Oct, 2018, 4:41 PM mottaz hejaze, wrote: > does your server support SSL ? did you configure your server for SSL ? > > On Wed, Oct 17, 2018 at 12:10 PM Joel Mathew wrote: > >> After attempt

Re: django username and password error

2018-10-17 Thread mottaz hejaze
does your server support SSL ? did you configure your server for SSL ? On Wed, Oct 17, 2018 at 12:10 PM Joel Mathew wrote: > After attempting to redirect http to https by setting SECURE_SSL_REDIRECT > to True and a few other changes, suddenly I found myself locked out of > django login. It didnt

django username and password error

2018-10-17 Thread Joel Mathew
After attempting to redirect http to https by setting SECURE_SSL_REDIRECT to True and a few other changes, suddenly I found myself locked out of django login. It didnt accept my password, so I tried resetting it via manage.py passwd and manage.py changepassword. I even created a new superuser accou

Re: Using Primary key in two fields

2018-10-17 Thread Ігор Магур
As I saw earlier, Django does not allow you to have two rows as autofield, you can make your own save method for model. Ex. get first of YourModel.objects invert sorted by wanted field, add to it's value 1 and save ср, 17 жовт. 2018, 08:55 користувач Rakhee Menon пише: > Hi Everyone, > > I have