You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
966 B

from django.db import models
from django.urls import reverse
from django.utils.safestring import mark_safe
class Users(models.Model):
id = models.AutoField(primary_key=True)
user_id = models.BigIntegerField()
user_avatar = models.CharField(max_length=200)
user_name = models.CharField(max_length=500)
user_created_at = models.DateTimeField()
os = models.TextField(null=True)
config = models.TextField(null=True)
country = models.CharField(max_length=100, null=True)
checked_at = models.DateTimeField()
checked_in = models.CharField(max_length=200)
checked_in_id = models.BigIntegerField(null=True)
def image_tag(self):
return mark_safe('<img src="%s?size=128" width="50" height="50">' % self.user_avatar)
def show_profile(self):
return mark_safe(
'<a href="%s" target="_blank">Voir le profil</a>'
% reverse('tuxbot_gnous_eu:users_show', args=[self.user_id])
)