These are chat archives for django/django

Sep 2018
Shashank Parekh
Sep 13 2018 03:23
@MilanRgm Your Mapping is your BusinessModel.
Sep 13 2018 07:37
Thanks @sp1rs but how Segment is related with Industry then ? Sorry i did not understand this.
Shashank Parekh
Sep 13 2018 07:38
Segment is related with Industry in Mapping model.
I think i should execute this and see the output to understand it.
Sep 13 2018 07:49
Thanks for your help
Shashank Parekh
Sep 13 2018 08:25
On every industry search, Pick the segment from the Mapping.
I can’t see any problem in this.
Sep 13 2018 11:56
Any recommendation on Media library browser - so that users can browse the media present on the server, when uploading images, or files, from various forms from admin?
Sep 13 2018 12:22
@sp1rs I still think it should be something like this
class Segment(models.Model):
    industry = models.ForeignKey(Industry, related_name='segment', on_delete=models.CASCADE)
    name = models.CharField(max_length=150, blank=True, null=True)
Shashank Parekh
Sep 13 2018 12:45

@MilanRgm Ideally info related to segment should come in Segment model. Everything should be decoupled.
Let say you have same segment on multiple industry.
In your database

seg1, indsutry1
seg1, indsutry2
seg1, indsutry3

We have to normalize the database so that seg1 is not repeated.
My approach will avoid data duplication.

Thomas Matecki
Sep 13 2018 16:06
Maybe I'm missing it but does Django not have a HttpResponseRedirect class for a status 303?