Re: relations

2022-01-26 Thread bnmng
Hi, You shouldn't have to import since the models are in the same models.py On Wednesday, January 26, 2022 at 2:26:13 PM UTC-5 frank...@gmail.com wrote: > After trying the suggestions I get these errors. > > supplier.models: > > class Supplier(models.Model): > > name =

Re: Is there a function that returns common elements in multiple lists

2022-01-26 Thread Nick Farrell
>>> a = {1, 2, 3} >>> b = {2, 3, 4} >>> a & b {2, 3} On Wednesday, 26 January 2022 at 23:52:05 UTC+11 xaadx...@gmail.com wrote: > a = [1,2,3,4] > b = [3,4,5,6] > > Convert list a to set > a_set = set(a) > print(a_set.intersection(b)) > > On Wed, Jan 26, 2022, 5:47 PM Muhammad Shehzad wrote: > >>

Re: relations

2022-01-26 Thread frank dilorenzo
After trying the suggestions I get these errors. supplier.models: class Supplier(models.Model): name = models.CharField(max_length=50) phone = models.CharField(max_length=15, null=True, blank=True) email = models.CharField(max_length=120, null=True, blank=True) country =

Re: relations

2022-01-26 Thread frank dilorenzo
Thank you so much. Have a great day! frank- On Wed, Jan 26, 2022 at 6:51 AM bnmng wrote: > I would start by defining Supplier in your models.py, then Shipment with a > ForeignKey reference to Supplier > > I'm assuming (forgive me if I'm wrong) that not only can a shipment have > many

Re: intermittent migration error

2022-01-26 Thread Ben Cail
Thanks - https://code.djangoproject.com/ticket/33462. On 1/26/22 09:19, Jason wrote: nice find!  I would open a django issue, repeating what you have here, so Mariusz can see and triage. On Tuesday, January 25, 2022 at 2:10:18 PM UTC-5 Ben wrote: Hello, I ran into an intermittent

Re: intermittent migration error

2022-01-26 Thread Jason
nice find! I would open a django issue, repeating what you have here, so Mariusz can see and triage. On Tuesday, January 25, 2022 at 2:10:18 PM UTC-5 Ben wrote: > Hello, > > I ran into an intermittent migration issue on Django 4.x and PostgreSQL. > The migrations work fine on Django 3.2.x,

Re: how to design a beautiful homepage

2022-01-26 Thread 爱秋风
there are lots of free web, you can simply google 在2022年1月23日星期日 UTC+8 05:33:37 写道: > Hii, i want to make a beautiful home page for myself. Can anybody suggest > some code fr the same, I am new to django. > > Best regards, > Sarmi > -- You received this message because you are subscribed to

Re: relations

2022-01-26 Thread bnmng
I would start by defining Supplier in your models.py, then Shipment with a ForeignKey reference to Supplier I'm assuming (forgive me if I'm wrong) that not only can a shipment have many species, but a species can be in many shipments, so if that's the case, the most obvious way is to go with

Re: Is there a function that returns common elements in multiple lists

2022-01-26 Thread Muhammad Shehzad
a = [1,2,3,4] b = [3,4,5,6] Convert list a to set a_set = set(a) print(a_set.intersection(b)) On Wed, Jan 26, 2022, 5:47 PM Muhammad Shehzad wrote: > Use intersection > > On Wed, Jan 26, 2022, 4:06 PM bnmng wrote: > >> Thank you. I think I'll go with sets as advised, although this method >>

Re: Is there a function that returns common elements in multiple lists

2022-01-26 Thread Muhammad Shehzad
Use intersection On Wed, Jan 26, 2022, 4:06 PM bnmng wrote: > Thank you. I think I'll go with sets as advised, although this method > also looks very neat: > intersection = [item for item in list1 if item in list2] found at > https://datagy.io/python-intersection-between-lists/ > > > > > On

Re: Is there a function that returns common elements in multiple lists

2022-01-26 Thread bnmng
Thank you. I think I'll go with sets as advised, although this method also looks very neat: intersection = [item for item in list1 if item in list2] found at https://datagy.io/python-intersection-between-lists/ On Tuesday, January 25, 2022 at 3:11:10 PM UTC-5 joezep...@gmail.com wrote: