Hey all,

I am working on a web app using django where in the first view i.e the 
landing page I collect a piece of info around which the web app revolves. I 
need this piece of info to be saved across different views.

GOAL : Instead of the drop down in the diseaseName I want the disease 
entered in the previous view saved and transmitted to the next views.


MODELS : 

```

class Disease\_Profile(models.Model): """     Disease Profile Model with 
One to One mapping with diseaseName , for the Author to fill. 0    """ id = 
models.UUIDField(primary\_key=True, default=uuid.uuid4, editable=False) 
Disease\_Name = models.OneToOneField(diseaseName,on\_delete=CASCADE) 
Condition    = models.CharField(max\_length=250,) description  = 
models.CharField(max\_length=1000)

```

```

class Physician(models.Model): """    Physician Model to capture the best 
physician to be consulted for a particular disease    """ 
Disease\_Name=models.ForeignKey(diseaseName,on\_delete=models.CASCADE) 
physician\_category=models.ForeignKey(PhysiciansList,on\_delete=models.CASCADE) 
rating  = models.IntegerField(choices = Rating\_model.points,help\_text='1 
: Beign the Best Choice AND 10 : Being the least favorable choice.') 

```

VIEWS : 

```

def diseaseProfile(request): form = diseaseProfileForm() context = 
{'form':form} if request.POST: form = diseaseProfileForm(request.POST) if 
form.is_valid(): form.save() Disease_Name = 
form.cleaned_data.get('Disease_Name') print(Disease_Name) return 
redirect('/physicianCare/')

```

```

def PhysicianCare(request): form = PhysicianCareForm() context = 
{'form':form,} return render(request,'physicianCare.html',context)  

```


-- 
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/ff3a693a-fa88-4054-b9af-f2eee828df71n%40googlegroups.com.

Reply via email to