[no subject]

2024-01-08 Thread frank dilorenzo
I have 3 models as follows:

from django.db import models
from ckeditor.fields import RichTextField


# Create your models here.
class Species(models.Model):
scientific_name = models.CharField(max_length=50)
common_name = models.CharField(max_length=50, null=True, blank=True)
butterfly_image = models.ImageField(null=True, blank=True,
default="default.png")
# description = models.TextField(max_length=800, null=True, blank=True)
description = RichTextField(blank=True, null=True, default=None)

def __str__(self):
return self.scientific_name

class Meta:
ordering = ["scientific_name"]

=

from django.db import models


# Create your models here.
class Suppliers(models.Model):
name = models.CharField(max_length=60, null=True, blank=True)
phone = models.CharField(max_length=20)
email = models.EmailField(null=True, blank=True)
country = models.CharField(max_length=100, null=True, blank=True)
address = models.CharField(max_length=50, null=True, blank=True)
city = models.CharField(max_length=100, null=True, blank=True)
state = models.CharField(max_length=100, null=True, blank=True)
zipcode = models.CharField(max_length=15, null=True, blank=True)

class Meta:
ordering = ("name",)

def __str__(self):
return f"{self.name}"

=

from django.db import models
from suppliers.models import Suppliers
from species.models import Species


# Create your models here.
class Shipments(models.Model):
yes_no_choice = ((True, "Yes"), (False, "No"))

name = models.OneToOneField(
Suppliers, null=True, blank=True, on_delete=models.SET_NULL
)
species = models.OneToOneField(
Species, null=True, blank=True, on_delete=models.SET_NULL
)
label = models.CharField(max_length=20)
received = models.IntegerField(default=0)
bad = models.IntegerField(default=0, blank=True, null=True)
non = models.IntegerField(default=0, blank=True, null=True)
doa = models.IntegerField(default=0, blank=True, null=True)
para = models.IntegerField(default=0, blank=True, null=True)
released = models.IntegerField(default=0, blank=True, null=True)
entered = models.BooleanField(choices=yes_no_choice, default=False)
updated = models.DateTimeField(auto_now=True)
created = models.DateTimeField(auto_now_add=True)

def save(self, *args, **kwargs):
sub_quantity = self.bad + self.non + self.doa + self.para
self.released = self.received - sub_quantity

super().save(*args, **kwargs)

def __str__(self):
return str(self.name)

class Meta:
ordering = ["-created"]

==

I have a form to input shipment information:

{% extends 'base.html' %}
{% block title %}
  Create/Update form
{% endblock title %}
{% block content %}
  

  {% csrf_token %}
  {{ form.as_p }}
  
  
Back

  

  
{% endblock content %}

PROBLEM:


   - Shipments with this Name already exists.

Name:-BF.D.C.R.E.SE.B.N.ENTH.B.W.L.P.S.
 T.E.H.

Species:-Actias lunaAdelpha fessoniaAgraulis
vanillaeAnartia jatrophaeAnteos chlorindeAppias drusilla
 Archeaprepona
demophonArgema mimosaeAscia monusteAtrophaneura semperiAttacus
atlasBattus polydamasBiblis hyperiaBrassolis isthmiaCaligo
eurilochusCatonephele numiliaCatopsilia pyrantheCethosia cyane
 Charaxes brutusChilasa clytiaColobura dirceConsul fabiusDanaus
gilippusDione junoDircenna deroDoleschalia bisaltideDryadula
phaetusaDryas iuliaEryphanis polyxenaEueides isabellaEuphaedra
neophronEuploea phanaethreaEuxanthe wakefieldiGraphium angolanus
 Greta otoHamadryas amphinomeHebemoia glaucippeHeliconius
charitoniusHeraclides anchisiadesHypna clymenestraHypolimna
monteironisHypolimnas bolinaIdea leuconoeJunonia coeniaKallima
paraletkaLexia dirteaLimenitis archippusLycorea cleobaea
 Mechanitis
polymniaMelinaea ethraMemphis glyceriumMethona confusaMorpho
peleidesMyselia cyanirisNeptis hylasNessaea aglauraOpisiphanes
tamarindiOpsiphanes cassinaPachliopta aristolochiaePanacea
procillaPapilio thoasParides iphidamasParthenos sylviaPhoebis
argantePrecis atlitesPrepona omphalePterourus troilus
Rothschildea
lebeauSalamis anacardiiSiproeta epaphusTigridia acestaTirumala
septentrionisTithorea harmoniaTroides rhadamantusVindula dejone


Label:

Received:

Bad:

Non:

Doa:

Para:

Released:

Entered:YesNo

Back 


the supplier can have many species, many labels but if I try to add a
shipment with the same name I get an error saying the name already exists.
I need help trying to resolve this 

configuration

2023-01-18 Thread frank dilorenzo
I cannot seem to resolve this configuration correctly.

I have a list of suppliers.
A supplier can have one profile
A supplier can have many shipments.
A shipment can have many species

I have tried several ways and I always end up with some kind of circular 
problem.
Any thoughts are appreciated.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/60f10b20-ddff-46b6-ac89-63756a192831n%40googlegroups.com.


no data returned with filter

2022-03-14 Thread frank dilorenzo
models.py:
from django.db import models

from specie.models import Specie
from supplier.models import Supplier


class Shipment(models.Model):
supplier = models.ForeignKey(
Supplier, null=True, on_delete=models.DO_NOTHING)
created = models.DateTimeField(auto_now_add=True)
label = models.CharField(max_length=10)
specie = models.OneToOneField(Specie, on_delete=models.DO_NOTHING)
received = models.PositiveIntegerField(default=0)
bad = models.PositiveIntegerField(default=0)
non = models.PositiveIntegerField(default=0)
doa = models.PositiveIntegerField(default=0)
para = models.PositiveIntegerField(default=0)
released = models.PositiveIntegerField(blank=True)
entered = models.BooleanField(default=False)

# override save method
def save(self, *args, **kwargs):
self.bad + self.non + self.doa + self.para
self.released = self.received - \
(self.bad + self.non + self.doa + self.para)
super().save(*args, **kwargs)

def date_trunc_field(self):
return self.created.date()

def __str__(self):
return f"{str(self.supplier)} - {self.label} - 
{self.specie.scientific_name} - {self.created.strftime('%Y-%m-%d')}"

class Meta:
ordering = ["label"]


views.py
form = ShipmentSearchForm(request.POST or None)

if request.method == 'POST':
date_from = request.POST.get('date_from')
date_to = request.POST.get('date_to')
chart_type = request.POST.get('chart_type')

print(date_from, date_to, chart_type)
qs = pd.DataFrame(Shipment.objects.all().values())
print(qs)

qs1 = pd.DataFrame(Shipment.objects.filter(created__date=date_from))
print(qs1)

context = {
'form': form,
}

termial:

print(date_from, date_to, chart_type)
2022-02-01 2022-03-14 #1

qs = pd.DataFrame(Shipment.objects.all().values())
print(qs)

   id  supplier_id  created  label  specie_id 
 received  bad  non  doa  para  released  entered
0   52 2022-03-08 14:59:25.956019+00:00  33-33 14   
 30240 024False
1   27 2022-02-18 15:16:22.168860+00:00  64-15 27   
 20100 019 True
2   372022-02-18 16:14:43+00:00  64-15 32   
 25210 022 True
3   642022-03-10 00:00:00+00:00  66-66 59   
 40005 035False

qs1 = pd.DataFrame(Shipment.objects.filter(created__date=date_from))
print(qs1)

Empty DataFrame
Columns: []
Index: []

I cannot get any data when trying to get it using the filter. Any 
suggestions would be appreciated.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/91c89922-4f75-41aa-b706-56804cc01dd8n%40googlegroups.com.


Re: proper syntax for getting data many to many

2022-02-12 Thread frank dilorenzo
I apologize for anyone who looked at this.  Apparently I had a bunch of
typos. Can't read my own code.  Problem was solved by me re-typing the code.

frank-


On Sat, Feb 12, 2022 at 7:07 AM frank dilorenzo 
wrote:

> This is the model:
> ===
>
> from django.db import models
>
> # Create your models here.
> class Artist(models.Model):
> name = models.CharField(max_length=100, unique=True)
> slug = models.SlugField(max_length=100, unique=True,
> help_text='Unique value for artist page URL, created from name')
> birt_name = models.CharField(max_length=100, blank=True)
>
>
> class Song(models.Model):
> title = models.CharField(max_length=255)
> slug = models.SlugField(max_length=255, unique=True,
> help_text='Unique value for product page URL, created from name')
> youtube_link = models.URLField(blank=False)
> artists = models.ManyToManyField(Artist)
>
>
> this is the view:
> =
> from django.shortcuts import render
> from . models import Song
>
> # Create your views here.
>
> def song(request):
> song_list = Song.objects.all()
>
> context = {
> 'song_list': song_list,
> }
>
> return render(request, 'comments/song.html', context)
>
> this is the template:
> 
> 
> 
> 
> 
> 
> 
> Document
> 
> 
> 
> 
> 
> Artist
> Song
> 
> 
> 
> {% for song in song_list %}
> {% for artist in song.artist.all %}
> {{ artist.all }}
> {% for artist in song.artist.all %}
> 
> {{ artist.name }}
> {{ song.title }}
> 
> {% endfor %}
> {% endfor %}
> 
> 
> 
> 
>
> these are the database tables:
>
> comments_artist
> idnameslug   birth_name
>
> --
> 1 Moteh YN Mosses Noel
> 2 Chris Brown CB Christopher Maureen
>
> idtitleslug   youtube_link
>
> --
> 1 RoyalRoyal  http://youtube.com
> 2 Love Me   Love   http://youtube.com
>
> my problem is that I can see data when looking at the song {{ song.title }}
>
> I cannot see data when looking at the artist {{ artist.name }}
>
> the for loop syntax is for song in song_list
>
> the for loop syntax is for artist in song.artist.all
>
> What am I doing wrong here.  I been all over the web looking at examples
> but I can't seem to get this right.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/554793df-b5fe-4b51-94b9-46d2822405bbn%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/554793df-b5fe-4b51-94b9-46d2822405bbn%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbiy1Dc14Znsm79d5csSa-OT-89pvdoHKv2DUyYQYgOrv-Q5g%40mail.gmail.com.


proper syntax for getting data many to many

2022-02-12 Thread frank dilorenzo
This is the model:
===

from django.db import models

# Create your models here.
class Artist(models.Model):
name = models.CharField(max_length=100, unique=True)
slug = models.SlugField(max_length=100, unique=True,
help_text='Unique value for artist page URL, created from name')
birt_name = models.CharField(max_length=100, blank=True)


class Song(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField(max_length=255, unique=True,
help_text='Unique value for product page URL, created from name')
youtube_link = models.URLField(blank=False)
artists = models.ManyToManyField(Artist)


this is the view:
=
from django.shortcuts import render
from . models import Song

# Create your views here.

def song(request):
song_list = Song.objects.all()

context = {
'song_list': song_list,
}

return render(request, 'comments/song.html', context)

this is the template:







Document





Artist
Song



{% for song in song_list %}
{% for artist in song.artist.all %}
{{ artist.all }}
{% for artist in song.artist.all %}

{{ artist.name }}
{{ song.title }}

{% endfor %}
{% endfor %}





these are the database tables:

comments_artist
idnameslug   birth_name
--
1 Moteh YN Mosses Noel
2 Chris Brown CB Christopher Maureen

idtitleslug   youtube_link
--
1 RoyalRoyal  http://youtube.com
2 Love Me   Love   http://youtube.com

my problem is that I can see data when looking at the song {{ song.title }}

I cannot see data when looking at the artist {{ artist.name }}

the for loop syntax is for song in song_list

the for loop syntax is for artist in song.artist.all

What am I doing wrong here.  I been all over the web looking at examples 
but I can't seem to get this right.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/554793df-b5fe-4b51-94b9-46d2822405bbn%40googlegroups.com.


Re: relations

2022-01-27 Thread frank dilorenzo
After numerous attempts I think I found my solution. (NO ERRORS)

supplier/models.py


shipment = models.ForeignKey(

Shipment, on_delete=models.DO_NOTHING, null=True, blank=True)



specie/models.py



no reference to any other model



supplier/models.py

---

specie = models.ManyToManyField(Specie)




Thanks for all the suggestions.


frank-


On Thu, Jan 27, 2022 at 9:17 AM frank dilorenzo 
wrote:

> Well my friend, the only reason I have to do the imports is because each
> model is in it's own app. In every example I have seen the models are
> usually  small and contained in one app.
> Perhaps I need to redesign my project to have everything lumped together?
>
> In my project I have an app for base, shipment, supplier, species, and
> user.  Each app has its own rules of operations, meaning each has its own
> css, templates etc.
> I have looked at example until I am blue in the face but I cannot seem to
> get past the "cannot import name 'Supplier' from partially initialized
> module 'supplier.models' (most likely due to a circular import)
> (/Users/frankd/django" error.
>
> I'm not sure what the "partially initialized" is telling me.
>
> frank-
>
>
> On Wed, Jan 26, 2022 at 8:13 PM bnmng  wrote:
>
>> 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 = 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 = models.CharField(max_length=120, null=True, blank=True)
>>>
>>> address = models.CharField(max_length=120, null=True, blank=True)
>>>
>>> city = models.CharField(max_length=120, null=True, blank=True)
>>>
>>> state = models.CharField(max_length=120, null=True, blank=True)
>>>
>>> zipCode = models.CharField(max_length=10, null=True, blank=True)
>>>
>>>
>>> def __str__(self):
>>>
>>> return self.name
>>>
>>>
>>> shipment.models:
>>>
>>> 
>>>
>>>
>>> from django.db import models
>>>
>>>
>>> from specie.models import Specie
>>>
>>> from supplier.models import Supplier
>>>
>>>
>>> # Create your models here.
>>>
>>>
>>>
>>> class Shipment(models.Model):
>>>
>>> created = models.DateTimeField()
>>>
>>> specie = models.ManyToManyField(Specie)
>>>
>>> label = models.CharField(max_length=10)
>>>
>>> received = models.PositiveIntegerField()
>>>
>>> bad = models.PositiveIntegerField(default=0)
>>>
>>> non = models.PositiveIntegerField(default=0)
>>>
>>> doa = models.PositiveIntegerField(default=0)
>>>
>>> para = models.PositiveIntegerField(default=0)
>>>
>>> released = models.PositiveIntegerField(default=0)
>>>
>>> entered = models.BooleanField(default=False)
>>>
>>> supplier = models.ForeignKey(Supplier, on_delete=models.DO_NOTHING)
>>>
>>>
>>> def __str__(self):
>>>
>>> return self.supplier
>>>
>>>
>>> class Meta:
>>>
>>> ordering = ["label"]
>>>
>>>
>>> def __str__(self):
>>>
>>> return self.label
>>>
>>>
>>> # =#
>>>
>>> When I add the line supplier = models.ForeignKey(Supplier,
>>> on_delete=models.DO_NOTHING)
>>>
>>> I get this error:
>>>
>>>
>>> File "/Users/frankd/django_projects/Insectarium/src/shipment/models.py",
>>> line 4, in 
>>>
>>> from supplier.models import Supplier
>>>
>>>   File
>>> "/Users/frankd/django_projects/Insectarium/src/supplier/models.py", line 3,
>>> in 
>>>
>>> from shipment.models import Shipment
>>>
>>> ImportError: cannot import name 'Shipment' from partially in

Re: relations

2022-01-27 Thread frank dilorenzo
>
>> created = models.DateField(default=timezone.now)
>>
>>
>> def __str__(self):
>>
>> return self.scientific_name
>>
>>
>> class Meta:
>>
>> ordering = [
>>
>> "scientific_name",
>>
>> ]
>>
>>
>> def __str__(self):
>>
>> return self.scientific_name
>>
>>
>> # == #
>>
>> when I add the line shipment = models.ManyToManyField(Shipment)
>>
>> I get this error.
>>
>>
>> File "", line 241, in
>> _call_with_frames_removed
>>
>>   File
>> "/Users/frankd/django_projects/Insectarium/src/shipment/models.py", line 3,
>> in 
>>
>> from specie.models import Specie
>>
>>   File "/Users/frankd/django_projects/Insectarium/src/specie/models.py",
>> line 5, in 
>>
>> from shipment.models import Shipment
>>
>> ImportError: cannot import name 'Shipment' from partially initialized
>> module 'shipment.models' (most likely due to a circular import)
>> (/Users/frankd/django_
>>
>>
>>
>> I think I tried this before but couldn't resolve these errors. Any
>> suggestions would be appreciated.
>>
>>
>> frank-
>>
>>
>> On Wed, Jan 26, 2022 at 10:53 AM frank dilorenzo 
>> wrote:
>>
>>> 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 species, but a species can be in many shipments, so if that's the
>>>> case, the most obvious way is to go with ManyToMany for that relationship
>>>>
>>>> https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_many/
>>>>
>>>> class Supplier(models.Model):
>>>> (etc..etc..)
>>>>
>>>> class Shipment(models.Model):
>>>> supplier = models.ForeignKey(
>>>> Supplier,
>>>> on_delete=models. (...etc.. etc...)
>>>>
>>>> class Species(models.Model):
>>>> shipment = models.ManyToManyField(
>>>> Shipment,
>>>> (etc..)
>>>> On Monday, January 24, 2022 at 8:59:10 AM UTC-5 frank...@gmail.com
>>>> wrote:
>>>>
>>>>> I have tried several different ways but I cannot seem to get this
>>>>> right.  What I have is a list
>>>>> of suppliers.  Each supplier can have many shipments and each shipment
>>>>> can have many species.  Seems simple enough but apparently I must be more
>>>>> simple.
>>>>>
>>>>> I need a suggestion of how to relate these table.
>>>>>
>>>>> a supplier can have many shipment.  A shipment can have many species.
>>>>> Any help would be appreciated.  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 django-users...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/django-users/bc667e81-ce32-4df5-8f88-47dff3d852c8n%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/bc667e81-ce32-4df5-8f88-47dff3d852c8n%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/8f41caba-62f3-45e8-b4d6-e9584f9e8068n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/8f41caba-62f3-45e8-b4d6-e9584f9e8068n%40googlegroups.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbiy1BgLQ%3Dbsd1k6KntKvN_dsxK2-Q2M8h2uWBY3TWPO_-V1Q%40mail.gmail.com.


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 = models.CharField(max_length=120, null=True, blank=True)

address = models.CharField(max_length=120, null=True, blank=True)

city = models.CharField(max_length=120, null=True, blank=True)

state = models.CharField(max_length=120, null=True, blank=True)

zipCode = models.CharField(max_length=10, null=True, blank=True)


def __str__(self):

return self.name


shipment.models:




from django.db import models


from specie.models import Specie

from supplier.models import Supplier


# Create your models here.



class Shipment(models.Model):

created = models.DateTimeField()

specie = models.ManyToManyField(Specie)

label = models.CharField(max_length=10)

received = models.PositiveIntegerField()

bad = models.PositiveIntegerField(default=0)

non = models.PositiveIntegerField(default=0)

doa = models.PositiveIntegerField(default=0)

para = models.PositiveIntegerField(default=0)

released = models.PositiveIntegerField(default=0)

entered = models.BooleanField(default=False)

supplier = models.ForeignKey(Supplier, on_delete=models.DO_NOTHING)


def __str__(self):

return self.supplier


class Meta:

ordering = ["label"]


def __str__(self):

return self.label


# =#

When I add the line supplier = models.ForeignKey(Supplier,
on_delete=models.DO_NOTHING)

I get this error:


File "/Users/frankd/django_projects/Insectarium/src/shipment/models.py",
line 4, in 

from supplier.models import Supplier

  File "/Users/frankd/django_projects/Insectarium/src/supplier/models.py",
line 3, in 

from shipment.models import Shipment

ImportError: cannot import name 'Shipment' from partially initialized
module 'shipment.models' (most likely due to a circular import)
(/Users/frankd/django_



specie.models:

--

from django.db import models

from django.utils import timezone

from ckeditor.fields import RichTextField


from shipment.models import Shipment


# Create your models here.



class Specie(models.Model):

scientific_name = models.CharField(max_length=50)

common_name = models.CharField(max_length=50, blank=True, null=True)

description = RichTextField(blank=True, null=True)

image = models.ImageField(

upload_to="specie/images/species", default="no_picture.png"

)

shipment = models.ManyToManyField(Shipment)

created = models.DateField(default=timezone.now)


def __str__(self):

return self.scientific_name


class Meta:

ordering = [

"scientific_name",

]


def __str__(self):

return self.scientific_name


# == #

when I add the line shipment = models.ManyToManyField(Shipment)

I get this error.


File "", line 241, in _call_with_frames_removed

  File "/Users/frankd/django_projects/Insectarium/src/shipment/models.py",
line 3, in 

from specie.models import Specie

  File "/Users/frankd/django_projects/Insectarium/src/specie/models.py",
line 5, in 

from shipment.models import Shipment

ImportError: cannot import name 'Shipment' from partially initialized
module 'shipment.models' (most likely due to a circular import)
(/Users/frankd/django_



I think I tried this before but couldn't resolve these errors. Any
suggestions would be appreciated.


frank-


On Wed, Jan 26, 2022 at 10:53 AM frank dilorenzo 
wrote:

> 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 species, but a species can be in many shipments, so if that's the
>> case, the most obvious way is to go with ManyToMany for that relationship
>>
>> https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_many/
>>
>> class Supplier(models.Model):
>> (etc..etc..)
>>
>> class Shipment(models.Model):
>> supplier = models.ForeignKey(
>> Supplier,
>> on_delete=models. (...etc.. etc...)
>>
>> class Species(models.Model):
>> shipment = models.ManyToManyField(
>> Shipment,
>> (etc..)
>> On Monday, January 24, 2022 at 8:59:10 AM UTC-5 frank...@gmail.com wrote:
>>
>>> I have tried several different ways but I cannot seem to get th

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 species, but a species can be in many shipments, so if that's the
> case, the most obvious way is to go with ManyToMany for that relationship
>
> https://docs.djangoproject.com/en/4.0/topics/db/examples/many_to_many/
>
> class Supplier(models.Model):
> (etc..etc..)
>
> class Shipment(models.Model):
> supplier = models.ForeignKey(
> Supplier,
> on_delete=models. (...etc.. etc...)
>
> class Species(models.Model):
> shipment = models.ManyToManyField(
> Shipment,
> (etc..)
> On Monday, January 24, 2022 at 8:59:10 AM UTC-5 frank...@gmail.com wrote:
>
>> I have tried several different ways but I cannot seem to get this right.
>> What I have is a list
>> of suppliers.  Each supplier can have many shipments and each shipment
>> can have many species.  Seems simple enough but apparently I must be more
>> simple.
>>
>> I need a suggestion of how to relate these table.
>>
>> a supplier can have many shipment.  A shipment can have many species.
>> Any help would be appreciated.  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 django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/bc667e81-ce32-4df5-8f88-47dff3d852c8n%40googlegroups.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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbiy1Bm1aDHL_mt-%2B-FjFqrFz2yHqFc8M4MOdqs7kSa%2BFGUkg%40mail.gmail.com.


relations

2022-01-24 Thread frank dilorenzo
I have tried several different ways but I cannot seem to get this right.  
What I have is a list
of suppliers.  Each supplier can have many shipments and each shipment can 
have many species.  Seems simple enough but apparently I must be more 
simple.

I need a suggestion of how to relate these table.

a supplier can have many shipment.  A shipment can have many species.  Any 
help would be appreciated.  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 django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f673a2ac-d8fd-4da4-a39c-edae5fea5631n%40googlegroups.com.


cannot resolve FieldError

2021-07-18 Thread frank dilorenzo
I am getting this error message:

raise FieldError("Cannot resolve keyword '%s' into field. "
django.core.exceptions.FieldError: Cannot resolve keyword 'date' into 
field. Choices are: bad, created, doa, entered, id, non, para, received, 
released, slabel, specie, specie_id, supplier, supplier_id

these are my models:
Shipment:
class Shipment(models.Model):
supplier = models.ForeignKey(Supplier, on_delete=models.CASCADE)
created = models.DateTimeField(default=timezone.now)
slabel = models.CharField(max_length=10)
specie = models.ForeignKey(Specie, on_delete=models.CASCADE)
received = models.PositiveIntegerField(default=0)
bad = models.PositiveIntegerField(default=0)
non = models.PositiveIntegerField(default=0)
doa = models.PositiveIntegerField(default=0)
para = models.PositiveIntegerField(default=0)
released = models.PositiveIntegerField(default=0)
entered = models.BooleanField(default=False)

def get_absolute_url(self):
return reverse("shipments:detail", kwargs={"pk": self.pk})

def __str__(self):
return 
f"{self.specie.name}-{self.created.strftime('%Y/%m/%d')}-{self.supplier.name}"

suppliers:

class Supplier(models.Model):
supplierID = models.PositiveIntegerField(default=1)
name = models.CharField(max_length=120)
logo = models.ImageField(upload_to="suppliers", default="no_picture.png")
phone = models.CharField(max_length=15, null=True)
email = models.CharField(max_length=120)
country = models.CharField(max_length=120, null=True, blank=True)
address = models.CharField(max_length=120, null=True, blank=True)
city = models.CharField(max_length=120, null=True, blank=True)
state = models.CharField(max_length=120, null=True, blank=True)
zipCode = models.CharField(max_length=10, null=True, blank=True)

def __str__(self):
return self.name

species:

class Specie(models.Model):
name = models.CharField(max_length=50)
image = models.ImageField(upload_to="species", default="no_picture.png")
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.name

class Meta:
ordering = [
"name",
]

everything is working the way I want but when I try to get data into a 
variable I get the above error and I don't have a clue where to start to 
resolve this.  As from the models I have no field named date so I am 
confused.

The error is generated by this line:
qs = Shipment.objects.filter(date__range=[date_from, date_to])

even if I enter strings for testing, for example
qs = Shipment.objects.filter(date__range=['2021-01-01', '2021-02-01'])

I been all over the web looking for possible solutions but I am at a loss.  
Thanks for any thoughts or suggestions you may have.


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d4cbd3a1-92eb-48b1-8669-8e2b2a2196dan%40googlegroups.com.


Re: code question

2021-06-29 Thread frank dilorenzo
I thought I had been everywhere on the web but guess not.  This really
helped me a lot and I have it working now. Thanks a lot!

frank-


On Tue, Jun 29, 2021 at 7:57 PM Lalit Suthar 
wrote:

> https://youtu.be/SNXn76SI1Ks
> try this
>
> On Wed, Jun 30, 2021, 1:27 AM frank dilorenzo 
> wrote:
>
>> Here is a function view:
>>
>> def base(request):
>>
>> shipments = Shipment.objects.all().order_by("-slabel")[:5]
>>
>> suppliers = Supplier.objects.all()
>>
>>
>> context = {
>>
>> "shipments": shipments,
>>
>> "suppliers": suppliers,
>>
>> }
>>
>> return render(request, "base/dashboard.html", context)
>>
>>
>> I tried to figure this out myself but apparently I can't.  I want to
>> convert this to a class based view if possible but I couldn't figure out
>> how to send the context data to the .html file.  Not sure it that is even
>> possible.  I am new to django for sure.
>>
>>
>> Frank
>>
>> --
>> 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 view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-users/95d0558e-5f34-4e81-b20c-c95aee4af739n%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/95d0558e-5f34-4e81-b20c-c95aee4af739n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAGp2JVFDGwDMMb%2BKJ-SCamJToR2N94B4ENBhL2f5MQyQRhO-iw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAGp2JVFDGwDMMb%2BKJ-SCamJToR2N94B4ENBhL2f5MQyQRhO-iw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbiy1B1BOnYS4PSkWu8589htbh0v%3D706WE_WjJ%3DPSgKv0bXiw%40mail.gmail.com.


code question

2021-06-29 Thread frank dilorenzo
Here is a function view:

def base(request):

shipments = Shipment.objects.all().order_by("-slabel")[:5]

suppliers = Supplier.objects.all()


context = {

"shipments": shipments,

"suppliers": suppliers,

}

return render(request, "base/dashboard.html", context)


I tried to figure this out myself but apparently I can't.  I want to 
convert this to a class based view if possible but I couldn't figure out 
how to send the context data to the .html file.  Not sure it that is even 
possible.  I am new to django for sure.


Frank

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/95d0558e-5f34-4e81-b20c-c95aee4af739n%40googlegroups.com.


Re: circular imports error

2021-06-11 Thread frank dilorenzo
I hate to sound corny but you sir are my hero!.  Thanks,  it all works now

frank-


On Fri, Jun 11, 2021 at 2:43 PM Adam Stein  wrote:

> Since you said 3 separate apps, I assume each of these classes are in a
> separate file. However, you have the line:
>
> from .models import Supplier
>
> which would make it seem that Supplier is defined in the same file as
> Shipment. Shipment should be in ".models" and if Supplier is also defined
> in the same file, no need to import it. If it's defined in a different
> file, then the import should reference another place, not ".models".
>
> On Fri, 2021-06-11 at 12:22 -0700, frank dilorenzo wrote:
>
> Hello,  I have 3 separate app as follow:
> from django.db import models
>
> # Create your models here.
>
> # Supplier can have many shipments
> class Supplier(models.Model):
> name = models.CharField(max_length=120, null=True)
> phone = models.CharField(max_length=15, null=True)
> email = models.CharField(max_length=120, null=True)
> created = models.DateTimeField(auto_now_add=True)
> updated = models.DateTimeField(auto_now=True)
>
> def __str__(self):
> return self.name
> -
> from django.db import models
> from django.utils import timezone
>
> # Create your models here.
>
> # A specie can belong to many shipments
> class Specie(models.Model):
> name = models.CharField(max_length=120, null=True)
> image = models.ImageField(upload_to="species", default="no_picture.png")
> created = models.DateTimeField(default=timezone.now)
>
> def __str__(self):
> return self.name
> 
> from django.db import models
> from .models import Supplier
>
> # from .models import Supplier, Specie
>
> # Create your models here.
>
> # A shipment can have many species
> class Shipment(models.Model):
>
> supplier = models.ManyToManyField(Suppliers)
> specie = models.ManyToManyField(Species)
>
> name = models.CharField(
> max_length=120, null=True, help_text="enter name from Supplier above..."
> )
> slabel = models.CharField(max_length=10)
> received = models.PositiveIntegerField(default=0)
> bad = models.PositiveIntegerField(default=0)
> non = models.PositiveIntegerField(default=0)
> doa = models.PositiveIntegerField(default=0)
> para = models.PositiveIntegerField(default=0)
> released = models.PositiveIntegerField(default=0)
> entered = models.BooleanField(default=False)
> created = models.DateTimeField(default=timezone.now)
>
> def __str__(self):
> return f"{self.slabel}"
>
> ===
>
> when trying to migrate I get this error message:
>
> ImportError: cannot import name 'Supplier' from partially initialized
> module 'shipments.models' (most likely due to a circular import)
> (/Users/frankd/django_projects/stlzoo/src/shipments/models.py)
>
> I am stuck here and cannot seem to resolve this error.  I would truly
> appreciate any help on this.  Thanks.
>
> Frank
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c0aff4c4-651a-43ad-9ac9-42c6452a33f4n%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c0aff4c4-651a-43ad-9ac9-42c6452a33f4n%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>
> --
>
> Adam (a...@csh.rit.edu)
>
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/a5c49b5dedd58f28ba9d7039ed8977b626b53a1e.camel%40csh.rit.edu
> <https://groups.google.com/d/msgid/django-users/a5c49b5dedd58f28ba9d7039ed8977b626b53a1e.camel%40csh.rit.edu?utm_medium=email_source=footer>
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJbiy1CTynKdbOoPYyT%3DbB02YsEw3baFsdBr5dhG4NokcU2mBA%40mail.gmail.com.


circular imports error

2021-06-11 Thread frank dilorenzo
Hello,  I have 3 separate app as follow:
from django.db import models

# Create your models here.

# Supplier can have many shipments
class Supplier(models.Model):
name = models.CharField(max_length=120, null=True)
phone = models.CharField(max_length=15, null=True)
email = models.CharField(max_length=120, null=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)

def __str__(self):
return self.name
-
from django.db import models
from django.utils import timezone

# Create your models here.

# A specie can belong to many shipments
class Specie(models.Model):
name = models.CharField(max_length=120, null=True)
image = models.ImageField(upload_to="species", default="no_picture.png")
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.name

from django.db import models
from .models import Supplier

# from .models import Supplier, Specie

# Create your models here.

# A shipment can have many species
class Shipment(models.Model):

supplier = models.ManyToManyField(Suppliers)
specie = models.ManyToManyField(Species)

name = models.CharField(
max_length=120, null=True, help_text="enter name from Supplier above..."
)
slabel = models.CharField(max_length=10)
received = models.PositiveIntegerField(default=0)
bad = models.PositiveIntegerField(default=0)
non = models.PositiveIntegerField(default=0)
doa = models.PositiveIntegerField(default=0)
para = models.PositiveIntegerField(default=0)
released = models.PositiveIntegerField(default=0)
entered = models.BooleanField(default=False)
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return f"{self.slabel}"

===

when trying to migrate I get this error message:

ImportError: cannot import name 'Supplier' from partially initialized 
module 'shipments.models' (most likely due to a circular import) 
(/Users/frankd/django_projects/stlzoo/src/shipments/models.py)

I am stuck here and cannot seem to resolve this error.  I would truly 
appreciate any help on this.  Thanks.

Frank

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c0aff4c4-651a-43ad-9ac9-42c6452a33f4n%40googlegroups.com.


Re: model configuration

2021-06-06 Thread frank dilorenzo
Thanks Mike.  I'll give it a try.

Have a great day.

frank-


On Fri, Jun 4, 2021 at 8:42 PM Mike Dewhirst  wrote:

> Frank
>
> You don't have to import the class for the FK. Instead do a "lazy import".
>
> That means you just use "appname.Modelname" and Django is smart enough to
> fugure it out.
>
> Cheers
>
> Mike
>
>
>
> --
> (Unsigned mail from my phone)
>
>
>
>  Original message 
> From: frank dilorenzo 
> Date: 5/6/21 01:20 (GMT+10:00)
> To: Django users 
> Subject: Re: model configuration
>
> Thank Mike.  I am sorry for all this code but I am including it to show
> the problem I can't resolve.  I have 3 apps, shipment, supplier, specie.
> This is the models for them.
>
> from django.db import models
> from .models import Shipment
> from django.utils import timezone
>
> # Create your models here.
> # A specie can belong to many shipments
> class Specie(models.Model):
> shipment = models.ManyToManyField(Shipment)
> name = models.CharField(max_length=120, null=True)
> image = models.ImageField(upload_to="species", default="no_picture.png")
> created = models.DateTimeField(default=timezone.now)
>
> def __str__(self):
> return self.name
> ===
>
> from django.db import models
> from .models import Supplier
>
> # Create your models here.
> # A shipment can have many species
> class Shipment(models.Model):
>
> supplier = models.ForeignKey(Supplier, on_delete=models.CASCADE)
> slabel = models.CharField(max_length=10)
> received = models.PositiveIntegerField(default=0)
> bad = models.PositiveIntegerField(default=0)
> non = models.PositiveIntegerField(default=0)
> doa = models.PositiveIntegerField(default=0)
> para = models.PositiveIntegerField(default=0)
> released = models.PositiveIntegerField(default=0)
> entered = models.BooleanField(default=False)
> created = models.DateTimeField(auto_now_add=True)
>
> def __str__(self):
> return f"{self.slabel}"
> ==
>
> from django.db import models
>
> # Create your models here.
>
> # Supplier can have many shipments
> class Supplier(models.Model):
> name = models.CharField(max_length=120, null=True)
> phone = models.CharField(max_length=15, null=True)
> email = models.CharField(max_length=120, null=True)
> created = models.DateTimeField(auto_now_add=True)
> updated = models.DateTimeField(auto_now=True)
>
> def __str__(self):
> return self.name
>
>
> the error I can't resolve is:
> ImportError: cannot import name 'Supplier' from partially initialized
> module 'shipment.models' (most likely due to a circular import)
> (/Users/frankd/django_projects/tryit/src/shipment/models.py)
>
> thanks again.
> On Thursday, June 3, 2021 at 10:47:07 PM UTC-5 Mike Dewhirst wrote:
>
>> On 4/06/2021 1:39 pm, Mike Dewhirst wrote:
>> > On 4/06/2021 11:34 am, frank dilorenzo wrote:
>> >> I have the following conditions.
>> >> A supplier can have many shipments.
>> >> A shipment can have many species.
>> >> A shipment can have only one supplier.
>> >> Species can belong to many shipments.
>> >
>> > supplier 1:n shipment
>> > shipment n:m species
>>
>> shipment has FK to supplier
>>
>> species has m2m field with shipment
>>
>> The latter implements a connecting table between species and shipment
>> which can be expanded to carry additional information if you need to
>> include anything related to a particular shipment + species
>>
>> In all this I refer to the word species in its singular sense. E.g., we
>> are members of the human species.
>>
>>
>> >
>> >>
>> >> No matter how I try I can't seem to configure the models correctly.
>> >> I was hoping someone could help me on this.
>> >>
>> >> Thank you.
>> >> --
>> >> 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...@googlegroups.com
>> >> <mailto:django-users...@googlegroups.com>.
>> >> To view this discussion on the web visit
>> >>
>> https://groups.google.com/d/msgid/django-users/5ea61c33-9f24-470d-8191-177c2e73adf1n%40googlegroups.com
>> >> <
>> https://groups.google.com/d/msgid/django-users/5ea61c33-9f24-470d-8191-177c2e73adf1n%40googlegroups.com?utm_medium=email_source=footer>.
>>
>> >>
>> >
>>

Re: model configuration

2021-06-04 Thread frank dilorenzo
Thank Mike.  I am sorry for all this code but I am including it to show the 
problem I can't resolve.  I have 3 apps, shipment, supplier, specie. This 
is the models for them.

from django.db import models
from .models import Shipment
from django.utils import timezone

# Create your models here.
# A specie can belong to many shipments
class Specie(models.Model):
shipment = models.ManyToManyField(Shipment)
name = models.CharField(max_length=120, null=True)
image = models.ImageField(upload_to="species", default="no_picture.png")
created = models.DateTimeField(default=timezone.now)

def __str__(self):
return self.name
===

from django.db import models
from .models import Supplier

# Create your models here.
# A shipment can have many species
class Shipment(models.Model):

supplier = models.ForeignKey(Supplier, on_delete=models.CASCADE)
slabel = models.CharField(max_length=10)
received = models.PositiveIntegerField(default=0)
bad = models.PositiveIntegerField(default=0)
non = models.PositiveIntegerField(default=0)
doa = models.PositiveIntegerField(default=0)
para = models.PositiveIntegerField(default=0)
released = models.PositiveIntegerField(default=0)
entered = models.BooleanField(default=False)
created = models.DateTimeField(auto_now_add=True)

def __str__(self):
return f"{self.slabel}"
==

from django.db import models

# Create your models here.

# Supplier can have many shipments
class Supplier(models.Model):
name = models.CharField(max_length=120, null=True)
phone = models.CharField(max_length=15, null=True)
email = models.CharField(max_length=120, null=True)
created = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(auto_now=True)

def __str__(self):
return self.name


the error I can't resolve is:
ImportError: cannot import name 'Supplier' from partially initialized 
module 'shipment.models' (most likely due to a circular import) 
(/Users/frankd/django_projects/tryit/src/shipment/models.py)

thanks again.
On Thursday, June 3, 2021 at 10:47:07 PM UTC-5 Mike Dewhirst wrote:

> On 4/06/2021 1:39 pm, Mike Dewhirst wrote:
> > On 4/06/2021 11:34 am, frank dilorenzo wrote:
> >> I have the following conditions.
> >> A supplier can have many shipments.
> >> A shipment can have many species.
> >> A shipment can have only one supplier.
> >> Species can belong to many shipments.
> >
> > supplier 1:n shipment
> > shipment n:m species
>
> shipment has FK to supplier
>
> species has m2m field with shipment
>
> The latter implements a connecting table between species and shipment 
> which can be expanded to carry additional information if you need to 
> include anything related to a particular shipment + species
>
> In all this I refer to the word species in its singular sense. E.g., we 
> are members of the human species.
>
>
> >
> >>
> >> No matter how I try I can't seem to configure the models correctly.  
> >> I was hoping someone could help me on this.
> >>
> >> Thank you.
> >> -- 
> >> 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...@googlegroups.com 
> >> <mailto:django-users...@googlegroups.com>.
> >> To view this discussion on the web visit 
> >> 
> https://groups.google.com/d/msgid/django-users/5ea61c33-9f24-470d-8191-177c2e73adf1n%40googlegroups.com
>  
> >> <
> https://groups.google.com/d/msgid/django-users/5ea61c33-9f24-470d-8191-177c2e73adf1n%40googlegroups.com?utm_medium=email_source=footer>.
>  
>
> >>
> >
> >
>
>
> -- 
> Signed email is an absolute defence against phishing. This email has
> been signed with my private key. If you import my public key you can
> automatically decrypt my signature and be sure it came from me. Just
> ask and I'll send it to you. Your email software can handle signing.
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ae4089fd-3499-41e4-8409-1b3a7f83d96dn%40googlegroups.com.


model configuration

2021-06-03 Thread frank dilorenzo
I have the following conditions. 
A supplier can have many shipments. 
A shipment can have many species.
A shipment can have only one supplier. 
Species can belong to many shipments.

No matter how I try I can't seem to configure the models correctly.  I was 
hoping someone could help me on this.

Thank you.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/5ea61c33-9f24-470d-8191-177c2e73adf1n%40googlegroups.com.