Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django DateInput widget ignore initial value
I have a createview, with get_initial for initaliaze form data class CaricaDocumento(AppViewMixin, CreateView): model = Documento template_name = "carica_documento.html" form_class = CaricaDocumentoForm def get_initial(self): initial = CreateView.get_initial(self) oggi = date.today() c_year = int(oggi.year) initial["data"] = oggi initial["anno"] = c_year ultimoDoc = Documento.objects.filter( anno=c_year).order_by('-numero')[0] initial["numero"] = ultimoDoc.numero + 1 initial["fileOdt"] = None return initial then in the related form, i have the media class to set the widget for data input... class CaricaDocumentoForm(ModelForm): fileOdt = FileField( help_text="File ODT (OpenDocument) - Il documento modificabile", required=False) filePdfScansionato = FileField( help_text="File PDF con firme Scansionato", required=False) fileFirmato = FileField( help_text="File Firmato, p7m/CAdES oppure pdf/PAdES", required=False) [...] class Meta: fields = ["tipo", "numero", "anno", "data", "titolo", "servizio", "note"] widgets = { 'data': DateInput(format=('%m/%d/%Y'), attrs={'class': 'datetime-input', 'placeholder': 'Seleziona una data', 'type': 'date'}), } model = Documento The data field it's render correctly the widget (a cool datapicker) but ignore the initial values... it' renmdering the formt and not the value of oggi variable. Why? What i can do to render the initial value but also have the datapicker? -
Python django based accounting web framework
I am very much new to python and django and I am in the learning phase of django web framework. I want to build a web based erp system with the help of django web framework and python. I mean my erp system will include all source of calculation in the backend like the double entry accounting system and stock. Can anyone provide me some code sample or any link that will help me in my project. Thank you -
Django Stackedinline counter
So i have two model's and they are related to each other. I want to do a counter of how many objects i have related to another object: The Model1 can have many of Model2 . And for example when i go to the object1 and add a object2 the tittle is '1' because it is the first one , when i add another object2 to the object1 will be the '2'. class Model1(models.Model): ........... class Model2(models.Model): model1 = models.ForeignKey(Model1, on_delete=models.CASCADE,verbose_name="Projecto") def __str__(self): return format(counter) The admin class Model2Inline(admin.StackedInline): model = Model2 extra = 0 max_num = 4 class ProjetoAdmin(admin.ModelAdmin): inlines = [Model2Inline] -
How to get all values for a certain field in django ORM?
I have a table called user_info. I want to get names of all the users. So the table has a field called name. So in sql I do something like SELECT distinct(name) from user_info But I am not able to figure out how to do the same in django. Usually if I already have certain value known, then I can do something like below. user_info.objects.filter(name='Alex') And then get the information for that particular user. But in this case for the given table, I want to get all the name values using django ORM just like I do in sql. Here is my django model class user_info(models.Model): name = models.CharField(max_length=255) priority = models.CharField(max_length=1) org = models.CharField(max_length=20) How can I do this in django? -
Django Reusable Apps ModuleNotFoundError
I have written django polling apps by its doucumentation. The apps wroks great! I tried to make it reuseable following this documentation Django Reuseable Apps I have followe each and everything by setup.py and install it with PIP but if i run the server, it show me message, NoModuleFound name ''polls" I am confusing if plugged it in right way or wrong way -
Flask Modal vs Django Modal
Good Day. First of all, my apologize for mistakes in English. I was trying to transform my flask code to django, and got some error. I use Modal for delete button in flask, and want to make the same but in django. flask.html <button type = 'button' class = 'btn btn-danger btn-sm m-1' data-toggle="modal" data-target="#deleteModal">Delete</button> <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="deleteModalLabel">Do you realy want to delete?</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <form action = '{{ url_for('delete_genre', genre_id=genre.id) }}' method = 'POST'> <input type="submit" class = 'btn btn-danger' value = 'Delete'> </form> </div> </div> </div> django-code.html <button type = 'button' class = 'btn btn-danger btn-sm m-1' data-toggle="modal" data-target="#deleteModal" data-href = "{% url 'delete-genre' genre.pk %}">Delete</button> <div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title" id="deleteModalLabel">Do you realy want to delete?</h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">&times;</span> </button> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button> <form action = "{% url 'delete-genre' genre.pk %}" method = 'POST'> {% csrf_token %} <input type="submit" class = 'btn btn-danger' value = 'Delete'> </form> โฆ -
Use access token as authentication
I have installed django-oauth-toolkit and django-cors-middleware. I am able to create an access token using my API on Postman. I want to use the generated access token but how do I use this for authentication? I'm currently using the password grant type and it works fine on Postman. What do I pass on the /o/authorize/ endpoint? It gives me a 404 forbidden access. -
django-haystack. How can I filter `sqs.filter(id__in=qs_pk)` if I have `qs_pk` list with more than 1024 elements?
qs_pk = Vacancy.objects.values_list('pk', flat=True) sqs = SearchQuerySet().models(Vacancy) sqs = sqs.filter(id__in=qs_pk) I get exception when I try to use sqs.count() method, but if I restrict qs_pk = qs_pk[:1024] then It's all right. Exception which I get: elasticsearch.exceptions.RequestError: TransportError(400, 'search_phase_execution_exception', 'Failed to parse query [id:("281134" OR "281135" OR "272222" OR "287848" OR "190255" OR "266921" OR "235700" OR "235683" OR "281138" OR "281144" OR "186683" OR "281145" OR "281147" OR "244712" ................ -
.js files are not working when hosted on heroku using django
I have my .js file in static folder and it is loader on heroku run python manage.py collectstatic but when loading my site it is not running. It consists of some dropdowns but when site is loaded the drop downs are already open. It works fine on localhost. -
Django filter related_name subset in templates
I have a foreign key and I'm using the related_name field like so: class Pizza(models.Model): ... restaurant = models.ForeignKey('Restaurant', related_name='pizzas_offered') active = models.BooleanField(...) ... In any template I can run something like my_restaurant.pizzas_offered.all to get all the pizzas belonging to a particular restaurant. However, I only want the pizzas that are active (active=True). Is there a way to retrieve this subset in the template, without having to pass a separate variable in the view? Please note that I always want to only show the active pizzas only so if I have to make a change in the model to make this happen, that is fine too. -
"moduleNotFoundError" when sets scrapy as an app in django
When I tried to start my scrapy demo with scrapy crawl getCommodityInfo, the error below occurred. C:\Users\ๆๅฎ\PycharmProjects\GraduationProject\spiders\bin\JDSpider>scrapy crawl getCommodityInfo Traceback (most recent call last): File "D:\Anacaonda\Scripts\scrapy-script.py", line 5, in <module> sys.exit(scrapy.cmdline.execute()) File "D:\Anacaonda\lib\site-packages\scrapy\cmdline.py", line 141, in execute cmd.crawler_process = CrawlerProcess(settings) File "D:\Anacaonda\lib\site-packages\scrapy\crawler.py", line 238, in __init__ super(CrawlerProcess, self).__init__(settings) File "D:\Anacaonda\lib\site-packages\scrapy\crawler.py", line 129, in __init__ self.spider_loader = _get_spider_loader(settings) File "D:\Anacaonda\lib\site-packages\scrapy\crawler.py", line 325, in _get_spider_loader return loader_cls.from_settings(settings.frozencopy()) File "D:\Anacaonda\lib\site-packages\scrapy\spiderloader.py", line 45, in from_settings return cls(settings) File "D:\Anacaonda\lib\site-packages\scrapy\spiderloader.py", line 23, in __init__ self._load_all_spiders() File "D:\Anacaonda\lib\site-packages\scrapy\spiderloader.py", line 32, in _load_all_spiders for module in walk_modules(name): File "D:\Anacaonda\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules submod = import_module(fullpath) File "D:\Anacaonda\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 978, in _gcd_import File "<frozen importlib._bootstrap>", line 961, in _find_and_load File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 655, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed File "C:\Users\ๆๅฎ\PycharmProjects\GraduationProject\spiders\bin\JDSpider\JDSpider\spiders\getCommodityInfo.py", line 12, in <module> from spiders.bin.JDSpider.JDSpider.items import JDCommodity ModuleNotFoundError: No module named 'spiders' It seems that the spider cannot be found, but I don't know why it happened. My whole project hierarchy is here. GraduationProject is the django project. main and spiders are the applications of django. โฆ -
How to fetch all distinct objects of a parent ordered by some field in the child in django?
I have two Django models named, Categories and Item. A Category can have many Items The model Items has a property is_available which can be True or False. class Categories(models.Model): name = models.TexField() **some other fields** class Item(models.Model): project = models.ForeignKey(Categories,on_delete=models.CASCADE, related_name='category_item') name = models.TextField() is_available = models.BooleanField() This is how I am querying the db : all_cat = Categories.odjects.filter(**some_field**).order_by('-category_item__is_live').distinct() However I am still not geting distint results, I believe here distinct is working for items but not for Categories. I know the exact sql query, I can do that with it, but how do I query using django? -
Using Python, how to use gmail sendasalias with body?
i try to change sender with gmail send API in Django. In document, for changing "Users.settings.sendAs: update", i can send email with other sender and need to get two parameters(userId and sendAsEmail) service_user = service.users().settings().sendAs() service_user.patch(userId='me',sendAsEmail='example@gmail.com').execute() But, it request me parameter "body", what should i put in here? Traceback (most recent call last): File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/django/core/handlers/exception.py", line 39, in inner response = get_response(request) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response response = self.process_exception_by_middleware(e, request) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view return view_func(*args, **kwargs) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view return self.dispatch(request, *args, **kwargs) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/rest_framework/views.py", line 483, in dispatch response = self.handle_exception(exc) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/rest_framework/views.py", line 443, in handle_exception self.raise_uncaught_exception(exc) File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/rest_framework/views.py", line 480, in dispatch response = handler(request, *args, **kwargs) File "/Users/seokjaehong/work/alms-back/account/views/user/user/reset_password.py", line 58, in patch service = service_account_login(EMAIL_FROM) File "/Users/seokjaehong/work/alms-back/account/utils/send_email_by_gmail.py", line 148, in service_account_login service_user.patch(userId='me', sendAsEmail='example@gmail.com').execute() File "/usr/local/var/pyenv/versions/alms-back/lib/python3.6/site-packages/googleapiclient/discovery.py", line 737, in method raise TypeError('Missing required parameter "%s"' % name) TypeError: Missing required parameter "body" [19/Mar/2019 16:16:46] "PATCH /account/reset-password/ HTTP/1.1" 500 19583 pydev debugger: process 5403 is connecting -
how to use ajax on anchor link
I am working on a django application to display graphs. I want to use ajax with this application to prevent page refreshes. The problem is I don't know how to go about doing that with anchor tags. I tried ajax before with form submits. This is the code for form submit $(document).on('submit', '.csv_upload_form', function(event) { event.preventDefault(); csvUploadAjax(); }); function csvUploadAjax() { let $form = $(".csv_upload_form"); let form_data = new FormData($form[0]); $.ajax({ url: $form.attr('action'), type: $form.attr('method'), data: form_data, dataType: 'html', processData: false, contentType: false, success: function (data) { displayTable(data); }, error: function (xhr, status, err) { console.log("Something went wrong: " + err); } }); } But I don't know how to replicate this on anchor tags. This is my code so far html template <ul> <li><a href="{% url 'visualize' %}" class='link1'>Line Chart</a></li> <li><a href="#">Scatterplot</a></li> <li><a href="#">Bar Graph</a></li> <li><a href="#">Pie Chart</a></li> <li><a href="#">Heat Maps</a></li> <li><a href="#">Histogram</a></li> </ul> index.js $(document).on('click', 'a', function(event) { event.preventDefault(); onLinkClick(); }) function onLinkClick() { let $link = $('.link1'); let link_data = new FormData($link[0]); $.ajax({ url: $link.attr('action'), type: $link.attr('method'), data: link_data, dataType: 'json', processData: false, contentType: false, success: function (data) { showGraph(data); }, error: function (xhr, status, err) { console.log("Something went wrong: " + err); } }); } The โฆ -
Checkboxes event not triggering
Friends, Iโm using a Django application powered by Angular 1, in which a form is having a drop down of Checkboxes. Occasionally these checkboxes click events are not triggering for quite some time. The checkboxes are fetched by a python loop. Donโt understand why these events are not triggering. Any help would be much appreciated. -
Python script not working with django shell
i have written script to create users using csv file. i have to check the sso username is valid or not using an api request as well and its written in _validate_user function. To make the api request i'm using urllib3. Sample code provided below. import csv import urllib3.request from django.contrib.auth.models import User def _validate_user(sso_username): http = urllib3.PoolManager() fl_name = '<url>' + sso_username site_data = http.request('GET', fl_name) _data = site_data.data print(_data) FILENAME = r'./csv/usernames.csv' with atomic(): with open(FILENAME, 'rt', encoding='utf-8-sig') as f: reader = csv.DictReader(f) for i, row in enumerate(reader): user_name = row['username'] if _validate_user(user_name): User.objects.get_or_create( username=row['username'], password='password', ) print("User added") else: print("Invaid user") when i run the code using python3 manage.py shell and input code line by line i'm not getting any error and everything is working as expected. When i use python3 manage.py shell < utility_folder/load_users.py to run the script i'm getting NameError: name 'urllib3' is not defined at line number 6. What am i missing here. I tried with requests module also didn't do much help. Django version is 1.11 and python 3.6 Please advice. -
Webhook not returning any data from razorpay?
I am using django as my backend server, and everytime my user make a transaction using razorpay, i want a webhook to confirm the transaction id . But unfortunately the webhook seems to be triggering my url but no data is found in the request, i tried searching for the data in request.POST and request.FILES but both are empty -
How to put bootstrap design in CheckboxSelectMultiple on django forms
I have a dynamic column requirement in database and in my forms.py i have this RequirementForm to populate the number of requirement row in the database to html. class RequirementForm(forms.ModelForm): class Meta: model = ApplicantInfo fields = ('requirement',) widgets = { 'requirement': forms.CheckboxSelectMultiple, } Is there a way to put a bootstrap design on this one? because on my html code i only have this: {% extends 'applicant/base.html' %} {% block content %} <center> <!-- Default unchecked --> <form method = "post"> {% csrf_token %} {{ form }} <button type="submit">Save</button> </form> </center> {% endblock %} -
Customizing MulipleChoiceField
I want to write a custom Form that will retrieve column names from a dataframe and use these columns as choices in a MultipleChoiceField. The dataframe comes from a stored file from a Model. The code produces an error: project = Project.objects.filter(id=kwargs('pk')).first() TypeError: 'dict' object is not callable Here is my code: class PredictionCreateModelForm(forms.Form): global COLUMNS name = forms.CharField() model_type = forms.ChoiceField(choices=PREDICTION_TYPE, widget=forms.RadioSelect) columns = forms.MultipleChoiceField( choices=COLUMNS, widget=forms.CheckboxSelectMultiple) def __init__(self, *args, **kwargs): super(PredictionCreateModelForm, self).__init__(*args, **kwargs) project = Project.objects.filter(id=kwargs('pk')).first() df = pd.read_csv(project.base_file) global COLUMNS COLUMNS = df.columns class Meta: model = PredictionModel fields = ['name', 'model_type', 'columns'] -
Nav bar not extended to the full width of the page
snapshot The navbar is not getting extended if scroll the page to the right. I have used the bootstrap navbar from this page. (view-source:https://getbootstrap.com/docs/4.0/examples/navbars/)(second nav). I am using bootstrap.min.css. I have surfed StackOverflow for this issue. some post suggests using width: 100%; height: 150px; margin: 0px auto; position: relative; will resolve this issue. But I could not find the same in bootstrap.min.css. Also changing the same in bootstrap.css doesn't work. Please guide me to resolve this issue. Thanks -
Updating Image Field in Django REST Framework
I am trying to update the image field using Django Rest Framework. I am overiding the update method in views.py. Since i am doing a bulk update, that's why i have used a for loop and trying to update every field. THe issue is i don't know how to update an image field manually. So, any ideas or suggestions will be helpful. def update(self, request, *args, **kwargs): instance = self.get_object() response_data = { "kitchen_audit":[]} if not isinstance(request.data, dict): for kitchen_audit in self.request.data: kitchen_audit_instance = KitchenAudit.objects.get(id = kitchen_audit["id"]) kitchen_audit_instance.marks_scored = kitchen_audit['marks_scored'] kitchen_audit_instance.comment = kitchen_audit['comment'] kitchen_audit_instance.save() response_data["kitchen_audit"].append( {'id': kitchen_audit['id'], 'marks_scored': kitchen_audit['marks_scored'], 'comment':kitchen_audit['comment']}) for kitchen_audit_image in kitchen_audit["images"]: kitchen_audit_image_instance = KitchenAuditImage.objects.get (id=kitchen_audit_image["id"]) kitchen_audit_image_instance["image_url"] = kitchen_audit_image['image_url'] kitchen_audit_image_instance.save() -
Error creating docker image of django, gunicorn and nginx
I am not able to get the static files to come up. I've tried various settings and directory configurations and so on, but they just turn up as 404s. The folder structure of application as below . โโโ config โ โโโ nginx โ โโโ conf.d โ โโโ local.conf โโโ docker-compose.yml โโโ Dockerfile โโโ aggre โ โโโ aggre โ โโโ manage.py | โโโ static โโโ requirements.txt Settings.py look like STATIC_URL = '/static/' STATICFILES_DIRS = [os.path.join(BASE_DIR),'static'] STATIC_ROOT = os.path.join(os.path.dirname(os.path.dirname(BASE_DIR)), 'static') Dockerfile FROM python:3.6 ENV PYTHONUNBUFFERED 1 RUN mkdir -p /opt/services/django/src WORKDIR /opt/services/django/src COPY requirements.txt /tmp/ RUN pip install --requirement /tmp/requirements.txt COPY . /tmp/ COPY . /opt/services/django/src RUN python aggre/manage.py collectstatic --no-input # <-- here CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait" EXPOSE 8000 ADD . /opt/services/django/src CMD ["gunicorn", "--chdir", "aggre", "--bind", ":8000", "aggre.wsgi:application"] docker-compose.yml version: '2' services: djangoapp: build: . volumes: - .:/opt/services/django/src - static_volume:/opt/services/django/static/ networks: - nginx_network nginx: image: nginx:1.13 ports: - "80:80" volumes: - ./config/nginx/conf.d:/etc/nginx/conf.d - static_volume:/opt/services/django/static/ depends_on: - djangoapp networks: - nginx_network networks: nginx_network: driver: bridge volumes: static_volume: local.conf server { listen 80; server_name ***.***.io; location / { proxy_pass http://djangoapp:8000; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_redirect off; } location /static { alias /opt/services/django/static; โฆ -
Not able to iterate over a queryset in Django template
I need to iterate through a list of checkboxes and add a link to each of them. However I am not able to do so. The template shows the complete form as a link istead of an individual checkbox being a list. Below given is my code: Here is my forms.py: class GetTaskDescription(forms.Form): get_tasks = forms.ModelMultipleChoiceField( queryset=Task.objects.none(), widget=forms.CheckboxSelectMultiple, required=True ) def __init__(self, *args, **kwargs): self.user = kwargs.pop('user') super(GetTaskDescription, self).__init__(*args, **kwargs) self.fields['get_tasks'].queryset = self.user.task_set.all() def get_task_description(self): tasks = self.cleaned_data['get_tasks'] return tasks Here is my html: {% extends 'todoapp/base.html' %} {% block title %}Select a Task{% endblock %} {% block content %} <h2>Select tasks to view description</h2> <form method="get" action="{% url 'view_task_description' %}" name="view_task_description"> {% for tasks in view_tasks %} <a href="#">{{ tasks }}</a> {% endfor %} <br/> &nbsp;&nbsp;<input type="submit" value="View Description"> &nbsp;&nbsp;<button onclick="location.href='{%url 'dashboard' %}?name=Go back'" type="button">Go back</button> </form> {% endblock %} Here is my views.py: @login_required(login_url='/login/') def view_task_description(request): task_description = GetTaskDescription(data=request.GET, user=request.user) if task_description.is_valid(): obj = GetTaskDescription.get_task_description(task_description) print obj return render(request, 'todoapp/task_desc.html', context={'description': obj}) return render(request, 'todoapp/select_task_description.html', context={'view_tasks': GetTaskDescription(user=request.user)}) -
Django WSGI application could not be loaded
I found an error while re-running the django application and there are some solutions on stackoverflow,but it is not working for me . django.core.exceptions.ImproperlyConfigured: WSGI application 'myapp.wsgi.application' could not be loaded; Error importing module. Also checked Django Middle-Ware,All are installed and Properly Configured. Following are the Middle-Ware i am using 'django_session_timeout.middleware.SessionTimeoutMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', MY DJANGO APPLICATION: myapp WSGI_APPLICATION = 'myapp.wsgi.application' Django Version: 2.1.7 Python : 3.7.1 -
Django how to implement a one-to-many self-dependent foreign key
I am implementing a User referral system, which existing users can refer other people to register an account with the link they provided. After the new user registers, the new user will be stored to the field 'referred_who' of the existing user. I have tried using the following method: class CustomUser(AbstractBaseUser): ... referred_who = models.ManyToManyField('self', blank=True, symmetrical=False) class ReferralAward(View): def get(self, request, *args, **kwargs): referral_id = self.request.GET['referral_id'] current_referred = self.request.GET['referred'] // referrer user = get_user_model().objects.filter(referral_id=referral_id) // user being referred referred_user = get_user_model().objects.filter(username=current_referred) for item in user: previous_referred = item.referred_who previous_referred.add(referred_user[0]) user.update(referred_who=previous_referred) And I got the following error: Cannot update model field <django.db.models.fields.related.ManyToManyField: referred_who> (only non-relations and foreign keys permitted). I am not sure if this method even works. I have check the Django Admin backend and I realized the 'Referred who' field actually contains all the users. It seems that it only highlightes the user being referred instead of only showing the referred users. Also, I tried to access the 'referred_who' field in the back-end and it returns 'None'. Is there a way to stored the users in the 'referred_who' field so that I can see all of the user being referred and access them in the back-end? For instance: โฆ