Re: keras

2020-05-31 Thread HJ
sorry I was using python 3.7.4 32bit and it required 64 , now it worked for 
me 

Le lundi 1 juin 2020 01:13:54 UTC+1, Franck Tchouanga a écrit :
>
> Which version are you trying to install
>
> On Mon, Jun 1, 2020, 00:39 HJ > wrote:
>
>> hello guys hope u r doing well 
>>
>> I want to use keras but I face the error like *there is no module named 
>> tensorflow* when I try to install it I face this error : 
>>
>> **ERROR: Could not find a version that satisfies the requirement 
>> tensorflow (from versions: none)*
>> *ERROR: No matching distribution found for tensorflow**
>>
>> do you have any suggestions ?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/04e69dab-2560-47ae-8c52-004b61ebd9ed%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/04e69dab-2560-47ae-8c52-004b61ebd9ed%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ec930528-b86f-4a9f-9b7e-54a0ea535dc4%40googlegroups.com.


keras

2020-05-31 Thread HJ
hello guys hope u r doing well 

I want to use keras but I face the error like *there is no module named 
tensorflow* when I try to install it I face this error : 

**ERROR: Could not find a version that satisfies the requirement tensorflow 
(from versions: none)*
*ERROR: No matching distribution found for tensorflow**

do you have any suggestions ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/04e69dab-2560-47ae-8c52-004b61ebd9ed%40googlegroups.com.


Re: Django json parser

2020-05-30 Thread HJ
you have to do a Queryset 
 inside your 
view function , something like :

@login_required
def Home(request):
 return render(request,'home.html',{})

@login_required
def JsonFunction(request):
 dataset = YourModel.objects.all() 
 data = list(dataset)
 return JsonResponse(data, safe=False)

that's only an example you need to set what you want to show 

Le samedi 30 mai 2020 14:12:07 UTC+1, bharat pamnani a écrit :
>
> I am a beginner in django and i need to build an app which enter some user 
> data and their activity period by creating model i can do that to store in 
> sql database.
> The problem is i need to display that data in json format any help will be 
> really appreciated 
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bce2ba78-b1a0-4ae6-8cd0-11290c7fadd7%40googlegroups.com.


Datetime Error

2020-05-26 Thread HJ
hello django-users hope you are doing well ! 

I was trying to convert the Date from string to timestamp 

def JsonDeliv(request):
 
 dataset = DeliveriesperDate.objects.all().values_list('Date',
'CountDeliveries')
 data = list(dataset)

  for i in data :
   data[i][0] = int(time.mktime(time.strptime(str(i),'%Y-%m-%dT%H:%M:%S.%Z'
))*1000)

  return JsonResponse(data, safe=False)



this is the error I get : ValueError: time data '(datetime.datetime(2020, 
5, 21, 0, 0, tzinfo=), 5)' does not match format '%Y-%m-%dT%H:%M:%S.%Z'

can you guys help me out !

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/121fd489-7fe3-4191-94b6-3ef8b14bf64a%40googlegroups.com.


Re: convert Date to milliseconds

2020-05-25 Thread HJ
thank you so much for your ideas , I am gonna fix this ^^

Le mardi 26 mai 2020 01:01:17 UTC+1, Samuel Nogueira a écrit :
>
> Hi! before answer you question I would recomend you to give a little fix 
> in your model and your function names. Try to follow the PEP8 style guide 
> for Python, in the guide is recommended using only capitalized words for 
> naming classes with composite names, and function names should be lowercase 
> with words separated by underscore. Thereby, would be more appropriate 
> naming your function and class this way: *class 
> MailItemCountDeliveriesPerDate()* and *def json_deliv()*. Fell free to 
> accept or ignore this tip.
>
> Now, back to the question, the DateTimeField() is a implementation of the 
> python datetime.datetime for storage in the database, so after you get the 
> Date from the database you can use the timestamp() method in the related 
> Date field. This will deliver the date in seconds format, then you just 
> multiply by 1000 to get your Date in milliseconds.
>
>  
>
> Hope this helps. Sorry if it got a little confusing.
>
>  
>
> *De: *HJ 
> *Enviado:*segunda-feira, 25 de maio de 2020 19:17
> *Para: *Django users 
> *Assunto: *convert Date to milliseconds
>
>  
>
> Hello everyone I want to convert my Date from string to *milliseconds*
>
>  
>
> this is my *models.py class *
>
>  
>
> *class* mail_item_count_deliveries_perDate(*models*.*Model*):
>
>countDeliveries = models.IntegerField(*default*=0)
>
>Date = models.DateTimeField()
>
>  
>
> this is my *views.py *
>
>  
>
> *def* jsonDeliv(*request*):
>
>  
>
>  dataset = mail_item_count_deliveries_perDate.objects.all().values_list(
> 'Date','countDeliveries')
>
>  data = *list*(dataset)
>
>  
>
>  return JsonResponse(data, *safe*=False)
>
>
> this is how the data looks like 
>
>  
>
> [["2020-05-21T00:00:00Z", 5], ["2019-05-21T00:00:00Z", 1], 
> ["2020-04-06T00:00:00Z", 3], ["2020-02-10T00:00:00Z", 2], 
> ["2020-01-23T00:00:00Z", 4],
>
>
> I want to convert the Date to milliseconds I want to use it in stock 
> highchart , and I don't know how to do it here can you guys help me please 
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to django...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/django-users/de8d3e67-2a68-45be-a9c9-fb06fbb206a6%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/django-users/de8d3e67-2a68-45be-a9c9-fb06fbb206a6%40googlegroups.com?utm_medium=email_source=footer>
> .
>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/9ea6d735-c752-4572-9f55-e0de4bdf3439%40googlegroups.com.


convert Date to milliseconds

2020-05-25 Thread HJ
Hello everyone I want to convert my Date from string to *milliseconds*

this is my *models.py class *

*class mail_item_count_deliveries_perDate(models.Model):countDeliveries 
= models.IntegerField(default=0)Date = models.DateTimeField()*

this is my *views.py *

def jsonDeliv(request):
 
 dataset = mail_item_count_deliveries_perDate.objects.all().values_list(
'Date','countDeliveries')
 data = list(dataset)
 
 return JsonResponse(data, safe=False)

this is how the data looks like 

[["2020-05-21T00:00:00Z", 5], ["2019-05-21T00:00:00Z", 1], 
["2020-04-06T00:00:00Z", 3], ["2020-02-10T00:00:00Z", 2], 
["2020-01-23T00:00:00Z", 4],


I want to convert the Date to milliseconds I want to use it in stock 
highchart , and I don't know how to do it here can you guys help me please 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/de8d3e67-2a68-45be-a9c9-fb06fbb206a6%40googlegroups.com.


JSON data

2020-05-24 Thread HJ
hello guys hope you are doing well 

I am trying to make a highchart but I found a problem in the view function 
so my chart doesn't show becuase of that 

view function 

def jsonDepend(request):
 dataset = mail_item_countries_depend.objects.all().values('exped','destin',
'count')
 data = list(dataset)

  return JsonResponse(data, safe=False)


my views function show something like this : [{"exped": "MA", "destin": 
"AL", "count": 2}, {"exped": "MA", "destin": "BS", "count": 1}]  

how can I store it like that : [["MA", "AL",  2], ["MA", "BS", 1]] 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/724f6ea8-87fe-42f2-bfac-d44c70cd30b9%40googlegroups.com.


Re: How to Insert Foreign Key into my user model with Abstractbaseuser

2020-05-22 Thread HJ
can you check this , I hope it's helpful 
https://stackoverflow.com/questions/28691771/django-foreignkey-to-abstractbaseuser

Le jeudi 21 mai 2020 13:11:50 UTC+1, 박지훈 a écrit :
>
> class User(AbstractBaseUser):
>password = models.CharField(max_length=128)
>username = models.CharField(unique=True, max_length=150)
>is_superuser = models.IntegerField()
>last_name = models.CharField(max_length=150)
>phone = models.CharField(max_length=20)
>email = models.CharField(max_length=254)
>date_of_birth = models.DateTimeField()
>date_joined = models.DateTimeField()
>last_login = models.DateTimeField(blank=True, null=True)
>is_staff = models.IntegerField(blank=True, null=True)
>is_active = models.IntegerField(blank=True, null=True)
>first_name = models.CharField(max_length=30, blank=True, null=True)
>
>
>objects = UserManager()
>
>USERNAME_FIELD = 'username'
>REQUIRED_FIELDS = ['last_name', 'phone', 'email', 'date_of_birth']
>
>def has_perm(self, perm, obj=None):
>   return True
>
>def has_module_perms(self, app_label):
>   return True
>
>class Meta:
>   db_table = 'auth_user'
>
>
> *This is my user model in app.models.py  *
>
>
> *I want to add foreign key into Class User. but i can`t ...*
>
>
> *please help me*
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/0bcd4d68-47c7-4479-bdea-01e58f604529%40googlegroups.com.


JSON file

2020-05-22 Thread HJ
hello django users hope you are doing well 

I want to do a highchart using a json file , and that's the problem I am 
facing , I want to create a json file in my views.py based on my columns 
below "countDeliveries"and "Dates"

class mail_item_count_deliveries_perDate(models.Model):
   countDeliveries = models.IntegerField(default=0)
   Dates = models.DateTimeField()


myJSON file should be something like that:
 

[
[
Dates,
countDeliveries
],
[
116769600,
5
],


 
- can you guys help me out 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/65341e88-88b1-480f-9d9a-39ce909ee4da%40googlegroups.com.