Presenting chosen main data in Django model

Presenting chosen main data in Django model

Postby curiousPaws » Mon Jul 18, 2016 6:28 pm

Hello, I am currently constructing the model, and now facing this problem. I will present a form (ModelForm later) to a user that lets him or her pass either a URL or a local sample by choosing between buttons (in the future) together with the other customizations (ex. in logging files), because I will pass them later to another software for a test. So in, I put:
Code: Select all
class sample(models.Model):
   url_sample_name = models.URLField(required=False)
   local_sample_name = models.FilePathField(required=False, recursive=False)
        .... # other data elements that will be present in both forms, whatever kind of sample is chosen.

I just want to ask, if how am I going to present, if after passing the form and submitting the sample to the another software, how will I know which sample was filled up? If it was the local sample or the URL sample... Tips and suggestions will be appreciated, just to clear out my mind. :?: :) :)
Posts: 6
Joined: Sun Jun 26, 2016 5:13 pm

Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest