Is it possible to do 2 POST request in a single template. I have a webpage that has a drop down box. This drop down box loops a database to display hostname (the field in my database). With the chosen hostname, further details are displayed regarding the hostname in another table to another drop down box for user to choose. Then there are textboxes to key for user to key in more detailed details. And finally there is a save button at the end. Or i have to make 2 different templates. Whereby the first one is to get the selected value then the next one for user to key in data?
Also, 1 question. I have a string i have used it to get the selected choice from my template. But it says device matching query does not exist. This the statement i used:
selecteddata = Device.objects.get(hostname='selected')
selected contains the string of
This my model for Device:
class Device(models.Model): hostname = models.CharField(max_length=50, unique = True) ipaddr = models.GenericIPAddressField(protocol='ipv4', unique=True, verbose_name='mangement IP') ##Use for mgt_id_addr date_added = models.DateTimeField(default=timezone.now) def __str__(self): return self.hostname
And in my table, there is the record of TestTest