My model looks like this:
from django.contrib.postgres.fields import ArrayField
class Trigger(models.Model):
solutions = ArrayField(models.TextField(blank=True, null=True), blank=True, null=True, help_text='some helpful text')
This allows me to enter a comma separated list of solutions by default. For example: I can enter in this text box:
1. watch out for dust.,
2. keep away from furry animals.,
This creates a list of two separate string elements. However, if the decision text itself contains a comma, for example:
1. cockroaches, polens and molds might be harmful.
This will create two separate solution lines due to the presence of a comma in this sentence.
How to tell django to use a different separator than a comma, as this will almost certainly be part of the sentences. How to use delimiter as '|'? I looked into the array class, but it does not allow separation.
source
share