Django community: RSS
This page, updated regularly, aggregates Django Q&A from the Django community.
-
django post last_login time of user
I want when user login the last_login case get updated . this is my login view : def loginPage(request): if request.user.is_authenticated: return redirect('home') else: if request.method == 'POST': username = request.POST.get('username') password =request.POST.get('password') user = authenticate(request, username=username, password=password) if user is not None: login(request, user) return redirect('home') else: messages.info(request, 'Username OR password is incorrect') context = {} return render(request, 'accounts/login.html', context) and this is my user table : any advices ? -
Django-FIle download issues
In my application, many users can upload files. There is no fixed file type as the user can upload any kind of file. I am trying to create a view through which the file could be downloaded. It goes like this def download_file(request,id): file = t_data.objects.get(id=id) fl_path = "media/file_name.extension" filename = file.file_name fl = open(fl_path, 'r') mime_type, _ = mimetypes.guess_type(fl_path) response = HttpResponse(fl, content_type=mime_type) response['Content-Disposition'] = "attachment; filename=%s" % filename return response I am able to download .txt files but files with other extensions aren't downloading. Instead, I get this error when i try to download .py file UnicodeDecodeError at /download/9 'charmap' codec can't decode byte 0x9d in position 375: character maps to Request Method: GET Request URL: http://127.0.0.1:8000/download/9 Django Version: 3.1.7 Exception Type: UnicodeDecodeError Exception Value: 'charmap' codec can't decode byte 0x9d in position 375: character maps to Exception Location: C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py, line 23, in decode Python Executable: C:\Users\ukfle\AppData\Local\Programs\Python\Python39\python.exe Python Version: 3.9.1 Python Path: ['C:\Users\ukfle\Documents\pro', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\python39.zip', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\DLLs', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39', 'C:\Users\ukfle\AppData\Roaming\Python\Python39\site-packages', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\site-packages', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\site-packages\paypal_checkout_serversdk-1.0.0-py3.9.egg', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\site-packages\win32', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\site-packages\win32\lib', 'C:\Users\ukfle\AppData\Local\Programs\Python\Python39\lib\site-packages\Pythonwin'] Server time: Thu, 27 May 2021 11:41:34 +0000 I am quite beginner and don't know whats the problem. Please help me solve it. Thank you. If there is another approach for downloading files of all … -
How to add server-side apis to Django admin website?
I'm creating a Django app that can be installed on any Django website as a reusable PyPi package, Lets name it locations app. It has its own models.py, admin.py and let's assume that the custom models of this app have the following tables: class Country(models.Model): name = models.CharField(max_length=200) class City(models.Model): name = models.CharField(max_length=200) country = models.ForeignKey(Country, on_delete=models.CASCADE) class Location(models.Model): name = models.CharField(max_length=200) country = models.ForeignKey(Country, on_delete=models.CASCADE) city = models.ForeignKey(City, on_delete=models.CASCADE) And all these models are added to the admin website so users can access them from there. What I need to do is to add an API that lists all Cities for a specific Country so that this API is used in the background every time the user selects a country when adding or editing a location so that it then shows a list of all cities in the currently selected country. My problem is that if I define this API as a view in locations/views.py located somewhere by locations/urls.py. The URI of the API will be subject to the main urls.py of the website not only the locations/urls.py* and the URI of the admin website as well might vary depending on the main urls.py. So how can I make … -
How can i use get_queryset()object 'list_object' in other fuction
`class AboutView(ListView): template_name = 'index.html' model = Product def get_queryset(self): object_list = self.model.objects.all() return object_list def get(request, self): new_list = object_list return new_list.order_to(-'price')` -
I put <form> tag in my template into a for loop to show 5-star-rating for each image and user can rate but its only saving response of 1st element
i try to make a website with different images and user can give 5=-star-rating to them so i save the images from admin side and place a card into loop to show all the present data from database and with that i also place 5-star- rate to give rating but it saving the data of 1st image only in the card i want it to save rating of each image, i search it everywhere but cant find any solution please help me with this. This is my HTML page <div class="container"> <div class="row"> {%for a in ab%} <div class="col-4"> <div class="card"> <img class="card-img-top" src="{{a.image.url}}"> <div class="card-body"> <h5 class="card-title">{{a.product}}</h5> <div class="col text-center"> <form class="rate-form" action="" method="POST" id="{{a.id}}"> {% csrf_token %} <button type="submit" class="fa fa-star fa-3x my-btn" id="first"></button> <button type="submit" class="fa fa-star fa-3x my-btn" id="second"></button> <button type="submit" class="fa fa-star fa-3x my-btn" id="third"></button> <button type="submit" class="fa fa-star fa-3x my-btn" id="fourth"></button> <button type="submit" class="fa fa-star fa-3x my-btn" id="fifth"></button> </form> <br> <div id="confirm-box"></div> </div> </div> </div> {%endfor%} </div> </div> This is my java-script // console.log('hello world') // get all the stars const one = document.getElementById('first') const two = document.getElementById('second') const three = document.getElementById('third') const four = document.getElementById('fourth') const five = document.getElementById('fifth') // get the form, … -
unable to import pycryptodome in django
I have created a django-project called dp1 and inside that I have made a djano-app called da1. I am working on Windows inside a virtual env named testing. da1\views.py from django.shortcuts import render # Create your views here. from django.http.response import HttpResponse from django.shortcuts import render import hashlib from Crypto import Random from Crypto.Cipher import AES from base64 import b64encode, b64decode import os class AESCipher(object): def __init__(self, key): self.block_size = AES.block_size self.key = hashlib.sha256(key.encode()).digest() def encrypt(self, plain_text): plain_text = self.__pad(plain_text) iv = Random.new().read(self.block_size) cipher = AES.new(self.key, AES.MODE_CBC, iv) encrypted_text = cipher.encrypt(plain_text.encode()) return b64encode(iv + encrypted_text).decode("utf-8") def decrypt(self, encrypted_text): encrypted_text = b64decode(encrypted_text) iv = encrypted_text[:self.block_size] cipher = AES.new(self.key, AES.MODE_CBC, iv) plain_text = cipher.decrypt(encrypted_text[self.block_size:]).decode("utf-8") return self.__unpad(plain_text) def __pad(self, plain_text): number_of_bytes_to_pad = self.block_size - len(plain_text) % self.block_size ascii_string = chr(number_of_bytes_to_pad) padding_str = number_of_bytes_to_pad * ascii_string padded_plain_text = plain_text + padding_str return padded_plain_text @staticmethod def __unpad(plain_text): last_character = plain_text[len(plain_text) - 1:] return plain_text[:-ord(last_character)] # Create your views here. def home(req): return render(req,'home.html',{"name":"Manish"}) def add(req): choice = req.POST['choice'] # value of selected radio button val1 = req.POST['text1'] val2 = req.POST['text2'] result = choice+val1+val2 key_128 = "kuch bhi" iv = "InitializationVe" aesCipher = AESCipher(key_128) print(aesCipher.key) sentence = "manish swami" print(aesCipher.encrypt(sentence)) return render(req, 'result.html' ,{'result': result}) from … -
how can Control/write Temperature value with RS485port, from Django web?
''''Hello, I have PID temperature controller with RS485 communication port. I can read & write the resister values by connecting my 'controller' to serial PORT(com3). I want to Monitor and control the room temperature from Django-Web. please help me with this. I am completely new to Django & python however somehow I managed this much with the help internet. here is my code from where I can read and write the resister values. '''' *import pymodbus import serial from pymodbus.pdu import ModbusRequest from pymodbus.client.sync import ModbusSerialClient as ModbusClient from pymodbus.transaction import ModbusRtuFramer import time,os client= ModbusClient(method = "rtu", port="COM7",stopbits = 1, bytesize = 8, parity = 'N', baudrate=9600) #connect to the serial modbus server connection = client.connect() print(connection) pv=client.read_input_registers(6,3,unit=0x01) print(pv.registers) time.sleep(2) time.sleep(2) #set 1= 184 #controller has 3 different set points which can be seen on device's LCD display. #set 2= 187 #set 3= 189 set=int(input("enter the set => ")) if(set==1): address=184 #communication address for set 1 elif (set==2): address=187 #communication address for set 2 elif (set==3): address=190 #communication address for set 3 else: print("adress not recognised") time.sleep(2) re = client.read_holding_registers(address,3,unit=0x01) print(re.registers) time.sleep(2) value = int(input("Enter the value => ")) result=client.write_registers(address,[value,0,0],unit=0x01) #0xB8= 184 -offset address, 0xB9=185- value, *3= Number of … -
Django models inheriting from ABC: causes TypeError: metaclass conflict
I am using Django 3.2 and I have come across a problem relating to multiple inheritence where one of the parent classes is an ABC: # Interfaces from abc import ABC, abstractmethod class Foo(ABC): @abstractmethod def get_actionable_object(self): raise NotImplementedError('This method must be implemented in concrete subclasses!') class FooBar(models.Model, ActionableModel): items = GenericRelation(Item) # ... class Meta: abstract = True When I run python manage.py check, I get the following error message: TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases I tried this (from the error message): class FooBar(models.Model, ActionableModel): items = GenericRelation(Item) # ... class Meta(models.Model, ActionableModel: abstract = True But I am getting the same error message. What is causing this error message - and how do I fix it? -
How can I use both safe and truncatechars method?
I trying to solve this problem throughout the day. I want you to use the safe method so no one sees the HTML tags and also want to truncatechars to short the description. I want to do that if anyone wants to read that article must redirect to a detailed page of that article. I've created some dummy posts using faker. When I try to create a post there some HTML tags shown on the home page it's because of Froala Editor so try to use a safe method to remove the tags. So use this way <div class="description"> {{post.description|truncatechars:150|safe}} </div> After using this way my nothing is showing on my post description and also other posts also not showing even the sidebar also gone. After I remove the safe method it's back to normal. You check these images using the safe method and without a safe method.Same thing happens when I use autoescape tag -
Django multiple user types Project Structure
I have a Django project to implement. I have 2 models for different user types : class Applicant(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,primary_key=True) telephone = models.CharField(max_length = 10) address = models.CharField(max_length=50) city = models.CharField(max_length=64) country = models.CharField(max_length=50) birthDate=models.DateField() GENDER_CHOICES = ( ('M', 'Male'), ('F', 'Female'), ) gender = models.CharField(max_length=1, choices=GENDER_CHOICES) citizenship = models.CharField(max_length=64) def __str__(self): return self.user.username class Evaluator(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE,primary_key=True) telephone = models.CharField(max_length = 10) committee = models.ForeignKey(Call,on_delete=models.SET_NULL,null=True) def __str__(self): return self.user.username And i have some apps with models: Application Department etc Should i make a new app for each user type :Applicant,Evaluator and make inside them different views and templates for each or should i make views inside the apps for each model and let user types have access by their permissions(I think if I do it that way i will have problems with templates and urls)? Thanks and sorry for my bad English(I am asking for first time) -
How to prevent IntegrityError in a django model
I am learning django and I follow this blog project on codemy youtube channel: https://www.youtube.com/watch?v=_ph8GF84fX4&ab_channel=Codemy.comCodemy.com And I wanted to improve my code with ForeignKey but I got stuck. I want to add a Category into my Post model. So I used the ForeignKey. Not every post has a categroy since I added this model just recently, but I used the default argument in the Category class, which should solve this problem. However, trying several options, I cannot migrate my models and run the server again. My code: from django.db import models from django.contrib.auth.models import User from django.urls import reverse class Category(models.Model): cat_name = models.CharField(max_length=300, default="uncategorized") def get_absolute_url (self): return reverse("blog") def __str__(self): return self.cat_name class Post(models.Model): title = models.CharField(max_length=300) author = models.ForeignKey(User, on_delete = models.CASCADE) body = models.CharField(max_length=30000) date = models.DateField(auto_now_add=True) category = models.ForeignKey(Category, on_delete=models.SET_NULL, null=True) def get_absolute_url (self): return reverse("post", args = [str(self.id)]) The error: django.db.utils.IntegrityError: The row in table 'blog_post' with primary key '1' has an invalid foreign key: blog_post.category_id contains a value 'uncategorized' that does not have a corresponding value in blog_category.id. -
Django nginx append slash and redirect issue
I have follwoing server block in my nginx test.conf.Nginx version 1.14.0(Ubuntu) upstream django { server 127.0.0.1:8000; } server{ listen 80; server_name localhost; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location /test { if ($request_uri ~ ^([^.\?]*[^/])$) { return 301 /; } proxy_pass http://django; } } With this I think whenever there is request with prefix /test arrives at server for example /test/debug(no end slash) the if statement inside the location block should redirect to / path. But something weird is happening in my case.When I go to /test/debug without forward slash, I get refirected to /test/debug/ but the strange thing is the server that redirects me is nginx/1.19.0 diff from the one on my host. And after redirect to /test/debug/ by this nginx version the path is handled by version on my main system . This is fine but strange . Also the redirect logs are not visible are not present in my main host access logs. So the main problems here are why is it redirection to diff location and where did this version came from. I have been usnig nginx-1.19.0 inside docker lately but at this moment all the containers are down.I did docker ps no nginx container was running there.I … -
How to compare two partial dates(i.e. todays date with past date) in python?
I am newbie in the programming and stackoverflow as well. I know this point might be discussed earlier but i personally couldn't find the one that can help me out. I am currently working on one of the django projects which has payment interface containing credit card details like credit card number, expiry date, cvv etc.As per client request i have used partial date using django's PartialDateField(Example: February 2025) in expiry date field. What i supposed to do is if any user enter the past date (lets say March 2019 which is not valid for expiry) then i wanted to set javascript alert from django views.py using comparison logic. something like this(just a short demo): Views.py: class billing(View): def get(self, request, *args, **kwargs): pass def post(self,request, *args, **kwargs): if entered_date>current_date: javascript alert submit the form successfully. As a beginner i have no idea how to compare two partial dates so that no one can enter past dates,Any kind of help would be appreciated. Thank you. -
ModelForm Instance vs Initial
I'm super new to Django, so bare with me. I'm trying to write a simple CRUD, using modelforms. In the update view, the form object initialization takes the arguments initial and instance, which confuses me. From django doc: "As with regular forms, it’s possible to specify initial data for forms by specifying an initial parameter when instantiating the form. Initial values provided this way will override both initial values from the form field and values from an attached model instance." Which confuses even more. I know my question isn't specific, but if someone could explain this and honestly, the background connection between the model and modelforms I would really appreciate it. Thanks y'all -
The best way to show some data from db due to 'url' from request in a template (layout)
I need to add some king of a help block to some pages of a website with multiple apps, views etc. I dont want to change all views, i want to get data for current page by its url as an unique id. So in by db it is stored like: ( 'block/page1' -> 'help text for page1', 'block/page2' -> 'help text for page2', etc.). I got a base template with html layout. I want to get the text for current page. How can i do that? Does {% load %} will help me with that? Thanks! -
Carousel in modal Django
Hello I am trying to put a carousel in my modal. everything was working fine until I put it. can someone please tell me what's wrong? gallery.html {% for photo in gallery %} × <div id="carouselExampleControls" class="carousel slide" data-ride="carousel"> <div class="carousel-inner"> <div class="carousel-item"> <img src="{{photo.imageURL}}" alt="First slide"> </div> </div> <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> </div> </div> </div> </div> {% endfor %} </div> </div> </div> -
Pass my df from panddf function,pass it as paramater to graphview function
In this code i reutrned pie chart for all my data in database.. Now I have filtered my data using pandas df in panddf funtion and I need to pass my df into grpahview function to get pie chart only for my filtered dataframe from django.http import JsonResponse from django.shortcuts import render from board.models import userboard from.utils import get_plot import pandas as pd from sqlalchemy import create_engine def graphview(request): qs =userboard.obects.all() x=[x.Month for x in qs] y=[y.Bp_Values for y in qs] chart = get_plot(x,y) return render(request, 'piechart.html' ,{'chart':chart}) def panddf(request): username = None if request.user.is_authenticated: username = request.user.username print(username) engine=create_engine('postgresql+psycopg2://postgres:#24May@2002@localhost/bhavesh') df = pd.read_sql_query('SELECT * FROM public."board_userboard"',con=engine) filt = (df['User_name'] == username) print(df[filt]) df1 = (df[filt]) return render(request, 'abc.html') -
Updating Django model field in template without page refresh using UpdateView
How can I update a model field in my template without page refresh? I am using UpdateView. I have considered using Ajax, but I have no idea how to implement this. Can you help me to how I can update the following TextField description in the template without need to refresh the page? models.py: class Measurement(models.Model): author = models.ForeignKey(User, null=True, on_delete=models.CASCADE) description = models.TextField(blank=True, default="", max_length=1200) views.py: class MeasurementView(LoginRequiredMixin, UserPassesTestMixin, UpdateView): model = Measurement template_name = 'ergolab/measurement.html' form_class = forms.MeasurementCreate def form_valid(self, form): form.instance.author = self.request.user return super().form_valid(form) def test_func(self): measurement = self.get_object() if self.request.user == measurement.author: return True return False template.html <form method="post" enctype="multipart/form-data"> {% csrf_token %} <fieldset class="form-group"> {{ form.description|as_crispy_field }} </fieldset> </form> -
Serializer field with source is not present in validated_data
I have added a field in serializer with source, Its validate function is being called, but its value is not present in validated_data. class MySerializer(serializers.ModelSerializer): # some fields new_name_field = serializers.CharField(source='model_field', required=False) # I have renamed this because I need "new_name_field" on my frontend. def validate_new_name_field(self, value): # do validations return value def validate(self, attrs): attrs = super().validate(attrs) print(attrs['new_name_field']) # This throws KeyError What am I doing wrong and How do I get the value of new_name_field in my validate function? -
How to prefetch_related fields for a related field in Django
I have seem some examples of how to prefetch_related fields in a forward and backward relationship in Django, but I have doubts about how can this be applied if we want to prefetch all the fields of a related model. For instance if I want to fetch all content from the following models, using the most optimized query: class HealthCheck(models.Model): id = models.Integer() person = models.ForeignKey('Person') class Person(models.Model): profile = models.ForeignKey('Profile') vaccines = models.ManyToManyField('vaccines', through='PersonVaccines') class Profile(models.Model): name = models.CharField(max_length=16) class PersonVaccines(models.Model): person = models.ForeignKey(Person) vaccine = models.ForeignKey('Vaccine') class Vaccine(models.Model): name = models.CharField(max_length=16) I have tried something like this but doesn't seems to work: from django.db.models import Prefetch HealthCheck.objects.filter(id=1).prefetch_related( Prefetch( 'person__vaccines', queryset=PersonVaccines.objects.select_related('person', 'person__profile', 'vaccine') ) ) How can I prefetch all the related content? -
Python, Django: Limit IntegerField inside models.py
I would like to ask, if it's possible to limit one IntegerField inside my model-class in comparison to another one!? For example: models.py class Example(models.Model): name = models.CharField(max_length=50, null=False, blank=False, unique=True) ports = models.IntegerField(default=1, validators=[MinValueValidator(1), MaxValueValidator(50)]) ports_active = models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(50)]) As you may see, the ports_active are related to ports!? Is it possible to limit the ports_active-field, so that it can only be less or equal, but never greater than ports? Thanks for your help and have a great day! -
My plugin adding functionality was missing after publishing the page
What could be the reason of empty structure but previously successfully added plugin to the page. Actually I published the page then, I entered the edit mode where the plugin option was missing and the previously added plugin option was still available? -
Get the Top 5 users in each month for the last three months Django
I have this query Post.objects.filter(issued_at__isnull=False, issued_at__gte=three_months_ago).annotate( month=TruncMonth('issued_at'))[:5].values('month').annotate(num_of_posts=Sum('number_of_posts')).values( 'month', 'user__name', 'num_of_posts').order_by('-num_of_posts')[:15] All I need right now is getting only the top 5 users of each month (so in total 15 users are going to be returned). As you can see I tried to slice 5 after the annotate but a AssertionError: Cannot reorder a query once a slice has been taken. error rises. Also, I tried slicing 15 users but that didn't work because the wrong users are being returned. -
Looking for assistance in eliminating duplication in the python code related to django
Hi can someone please help me in reducing the complexity of the below mentioned code as I am new to this I need it to reduce the amount of code and improve the code and to improve simplicity and reduce duplications in the overall coding any any help in this regard can be of great help and thanks in advance for your time and consideration in helping me in this regard. ''' def update(self, instance, validated_data): for key, value in validated_data.items(): if hasattr(instance, key): if key == "email_embedd": # special case instance.email_embedd = json.dumps(value) else: setattr(instance, key, value) # instance.ef_underwriter_decision = validated_data.get('ef_underwriter_decision', # instance.ef_underwriter_decision) # instance.ef_feedback = validated_data.get('ef_feedback', instance.ef_feedback) # NBI USE CASE if instance.ef_underwriter_decision == configur.get('decisions', 'non_binding_indication'): # enquiry Log dict_obj = temp_dict() # Update Submission table based on underwriter decision submission.objects.filter(email_id=instance.email_id).update(email_status='active') submission.objects.filter(email_id=instance.email_id).update( email_uwriter_decision=instance.ef_underwriter_decision) submission.objects.filter(email_id=instance.email_id).update( email_today_mail=configur.get('mailstatus', 'nbi_mail_type')) instance.email_today_mail = configur.get('mailstatus', 'nbi_mail_type') # setting email_today maio to 0 for submission fields # CR7.1 Changes (FROM COMPLETED TAB TO PROCESSED TAB) submission.objects.filter(email_id=instance.email_id).update( email_deleted=configur.get('mailstatus', 'nbi_mail_type')) temp_email_table = submission.objects.filter(email_id=instance.email_id).values( 'email_id', 'enquiry_id', 'email_sender', 'email_subject', 'email_broker', 'email_outlook_date', 'email_today_mail', 'email_assigned_user', 'email_deleted') for today in temp_email_table: for t in today: dict_obj.add(t, today[t]) if len(validated_data.get('ef_insured_name', instance.ef_insured_name)['name']) == 0: dict_obj.add('ef_insured_name', not_avbl) else: dict_obj.add('ef_insured_name', validated_data.get('ef_insured_name', instance.ef_insured_name)['name']) if len(validated_data.get('ef_obligor_name', instance.ef_obligor_name)['name']) == … -
Django Message Inbox
I'm pretty new on Django. I'm just trying to create a messaging app and i want to make a conversation inbox. To explain a little more there are two users like user1 and user2. I need to classify conversation between user1 and user2 also user2 and user3. Then I can get conversations with DRF to React. I looked up this article but I'm so confused. I think on generate conversation ID for this. But I don't know how to do this. models.py class Message(models.Model): sender = models.ForeignKey(User, related_name="sender", on_delete=models.CASCADE, related_query_name='s') reciever = models.ForeignKey(User, related_name="reciever", on_delete=models.CASCADE, related_query_name='r') msg_content = models.TextField(max_length=500, blank=True) sendtime = models.DateTimeField(auto_now_add=True) views.py class MessagesViewSet(viewsets.ModelViewSet): serializer_class = MessageSerializer authentication_classes = (JSONWebTokenAuthentication,) permission_classes = (IsAuthenticated,) def get_queryset(self): connected_user = self.request.user queryset = Message.objects.filter(reciever=connected_user) return queryset serializers.py class MessageSerializer(serializers.ModelSerializer): class Meta: model = Message fields = ('sender','reciever','msg_content','sendtime')