0

I am new to django platform. And I wanted to add a feature where you can tell if the data entered (let's say an advertisement) was done through django admin portal or through HTML form which is collecting data from user(let's say an advertisement).

And so I would be able to determine if it was someone inside the organization who entered the data using django admin or was it some user outside the organization who has given this data.

And further I want to sort the data accordingly.

  • If you need to know that information, you need to store it somewhere. – Daniel Roseman Jun 14 '19 at 18:42
  • I can set up settings.py for giving url where the information is stored. – anmol gupta Jun 14 '19 at 18:47
  • What? How will that help? – Daniel Roseman Jun 14 '19 at 18:49
  • Sorry if I got it wrong but I am trying it on localhost and have made a HTML form. and I have made changes in forms.py, models.py accordinlgy so that I can fill data using form or using django admin. No idea how django stores the data :) – anmol gupta Jun 14 '19 at 19:00
  • But that was exactly my point. You need to store the information. You have a model. The model is the right place to store the information. You should add a field to the model that identifies where the data comes from. – Daniel Roseman Jun 14 '19 at 19:04
  • Oh I see, but what field to add in model which can identify where the data comes from. (BTW Thank you for helping) Maybe I could express it further in boolean and set the data from HTML forms as FALSE and once it is validated from admin the data can be posted..? – anmol gupta Jun 14 '19 at 19:10
  • Django already stores the information in the [LogEntry](https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#logentry-objects) model, if added through the admin interface. – Ivan Jun 14 '19 at 19:18
  • Thank You Ivan and Daniel for your help!! – anmol gupta Jun 14 '19 at 19:22

0 Answers0