Developing E - Commerce Website

2019-07-23 Thread Lim Kai Wey
Greetings,

A new Django user here. I would like to ask if anyone could recommend any 
guides or tips in developing the functionalities in an E-Commerce website 
e.g.( Add to Cart). 
As well as the model setup for the products, is it better to have the all 
the products underneath one model OR it is better to separate them like, 
Book (Have all the fields required for books), Book Instance(Availability 
Check Box, UUID to keep track of transaction etc. etc.

Sorry for the long question. Thanks for reading and hope to hear some 
favorable replies.
Thank you once again!

Regards,
Kai Wey

-- 
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/0227c538-6c00-4afa-9e3a-a09f543d1c8c%40googlegroups.com.


Re: let the previous file as it is now i am doing another one and it is showing same problem

2019-07-23 Thread Lim Kai Wey
To Ajeet,

I believe this tutorial may help you understand authentication
implementations. It won’t ultimately be your end user registrations but
it’s a basic start.

Link:
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Authentication

Regards,
Kai Wey

On Tue, Jul 23, 2019 at 7:34 PM Ajeet Kumar Gupt 
wrote:

> Dear Team,
>
> I am very new in Django, I read tutorials of Django and python but I want
> to start the development process with a very small application.
>
> Like End User registration, end-user login. How to implement a little bit
> confused.  I need a help from your side how to start and how to implement a
> simple way.
>
>
> Thanks
>
> Ajeet
>
>
>
>
> On Tue, Jul 23, 2019 at 10:56 AM gilwell muhati 
> wrote:
>
>> Please have a look at this tutorial on how to retrieve data from models.
>>
>> http://www.learningaboutelectronics.com/Articles/How-to-retrieve-all-objects-of-a-database-table-in-Django.php
>>
>> You need to create a model in your models.py then use views.py to
>> retrieve it.
>> use a context in your views to pull multiple records  e.g
>>
>> destinations =  Destinations.objects.all()
>> context = {
>>  'destinations':destinations
>> }
>>
>>
>>
>>
>>
>>
>> *Regards,Gilwell Muhati | +254 710 739 116 | *
>> *~~“The mind is its own place and in itself can make a heaven of hell, a
>> hell of heaven…”~~John Milton *
>>
>>
>> On Tue, Jul 23, 2019 at 9:20 AM Mukul Dharwala 
>> wrote:
>>
>>>
>>> --
>> 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/CALO4FhFv53j5JMvFT%2Bgjp0bND30SkPofmtTGWJSMPmj_97u6cg%40mail.gmail.com
>> 
>> .
>
>
>>
>
> --
>
>
>
>
>
>
> *Thanks & Regards*
> Ajeet Kumar Gupt
> +91-9311232332
>
> --
> 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/CA%2BTqRss2bO%2B4UXDKzNw53JCQzT3WUoUPhAa6EyE_Frk3SJTMJQ%40mail.gmail.com
> 
> .
>

-- 
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/CAPcVkjifFrgRrUC-sw%2BE6t6MLG0tsLL%2B%3D2Z-c0-4cLTy-CF_Tw%40mail.gmail.com.


Re: Developing E - Commerce Website

2019-07-23 Thread Lim Kai Wey
To Daniel,

Thank you so much for your recommendation! I’ll go check it out! :)

Regards,
Kai Wey

-- 
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/CAPcVkjh8MU2itVp4XxCqAiYyu8mRTu2z2WPXaShEQK%3Db0BqFhA%40mail.gmail.com.


Re: Developing E - Commerce Website

2019-07-23 Thread Lim Kai Wey
Alright, thank you guys so much for the resources! I’ll take a look into
them!
Thank you guys so much for helping! :)

Regards,
Kai Wey

-- 
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/CAPcVkjjSh1zbWHZZNzcT_2DK7hyGFP3ug-TSTu%3D5Ap4q_tH9mQ%40mail.gmail.com.


Re: about Django tutorial

2019-07-24 Thread Lim Kai Wey
To  田村佑太,

*Is it fine if you show use your urls.py in the polls app as well? I
believe the problem is caused from there. *

*Regards,*
*Kai Wey*

On Wed, Jul 24, 2019 at 7:03 PM 田村佑太  wrote:

> Using the URLconf defined in mysite.urls, Django tried these URL
> patterns, in this order:
>
>1. admin/
>
> The current path, polls/, didn't match any of these.
>
>
> what is the problem of this?
>
>
> at ./mysite/mysite/urls.py
>
> I wrote this code.
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
> --
> 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/8ff414e9-c43d-4479-a330-b7a9492ccfd8%40googlegroups.com
> 
> .
>

-- 
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/CAPcVkjgMzcQ1Z5P%3D1BLKPsMTYw15WZUT_GDwqjerJfHpCCF3Yw%40mail.gmail.com.


Re: How to access first_name ad last_name in extended User model

2019-07-24 Thread Lim Kai Wey
To pastufrazio,

I believe instead of OneToOneField, you should try using,

user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE,
)

Since the authentication is imported.

Regards,
Kai Wey

-- 
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/CAPcVkjhSM%3DbNXeHy1GFrQ2ra9dhSNmxixFsCS15pXFG4QgBtxA%40mail.gmail.com.


Re: Writing your first Django app, part 1 - Can't Follow it

2019-07-31 Thread Lim Kai Wey
To Sammy,

Are you sure your urls.py is in the correct file directory? As in it should
be in mysite/mysite/urls.py instead of mysite/urls.py

Regards,
Kai Wey

-- 
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/CAPcVkjh5_TcV2DF9OcDKtfAzt%3D%3Djqcnivce5aq9bJTT0WuBeQQ%40mail.gmail.com.


Re:

2019-07-31 Thread Lim Kai Wey
I’m not sure this could help your situation but it did solve mine for Photo
Uploading, since uploading images and files are similar. Hope it helps!

https://stackoverflow.com/questions/34006994/how-to-upload-multiple-images-to-a-blog-post-in-django

Regards,
Kai Wey

-- 
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/CAPcVkjic_JyxnARyEt%3D74jYOkpDugYKyojp-rjuCaAtv1fvtuA%40mail.gmail.com.


Re: Writing your first Django app, part 1 - Can't Follow it

2019-07-31 Thread Lim Kai Wey
Sammy, would you mind attaching the whole project folder? Thanks

Regards,
Kai Wey

-- 
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/CAPcVkjjfaAg1WWDcDmKu4%3DWpys0tUkqGdOJnu-qTL2UcNi1dhw%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
如果有需要, 我能帮忙翻译,看你俩聊好像有点痛苦。

Translation:
I can help translate if you guys want... I don’t mind translating

Regards,
Kai Wey

-- 
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/CAPcVkjh222cJWGy0zHc4K%3DhXpMCq_2kCJLc3HnEcMBjAdTYiiw%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
哈哈哈 我真不介意,大家都来这学习嘛。互相帮忙是应该的。

Translation:
I really don’t mind translating, this is where we all learn. It’s a must to
help each other out.

Ps. The three letters he said translate that I’m a nice person

Regards,
Kai Wey

-- 
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/CAPcVkjhWMXyrfoCzOC_CD%3DOFPkjUMHN%2BCe44FgbhxbHjVp63jw%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
请翻译 :
问题是由于python2.7 和python3.6 之间的版本差异导致的。
这位小兄弟在使用python3.6 的版本。加载一个python2.7 版本的包。django-common。 需要寻找这个包的python3.6
版本, 如果没有这个版本的话 就需要寻找其他的解决方案。

Translates:
The problem is due to the difference between the Python version 2.7 and
3.6. Because you’re using Python 3.6, you’ll have to have another Python
2.7’s package.  The Django-Common package will search for its package that
is in Python 3.6, if there aren’t any package in this version then you’ll
have to look for another solution.

Regards,
Kai Wey

-- 
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/CAPcVkjjHucKbfbhSPqUz%3DEESpqpy8jVYNrkQ-2L2rYupO7_q1g%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
>
> I want to build the follow system in my website how i can do that
>>
> beacuse i am using that ajax so that i can
>
building follow system
>
and i am learning from
https://learning.oreilly.com/library/view/django-2-by/9781788472487/d61f6f4a-a9f1-4f9f-b0eb-18ae1518a2dd.xhtml

翻译:
他说,他需要用那系统来设计他网站。他都是靠Ajax 设计那网站的。他都在这学的
https://learning.oreilly.com/library/view/django-2-by/9781788472487/d61f6f4a-a9f1-4f9f-b0eb-18ae1518a2dd.xhtml

Ps. I just wanna say please use propose grammar so I can translate more
accurately. Thanks

Regards,
Kai Wey

-- 
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/CAPcVkjj_Ji07K0YznceqwiDNPDn4GD0fLh36fYdffPnNwfxPxQ%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
他还有问要怎么弄才行。

-- 
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/CAPcVkjgYTFrnYbjDGn0jv3%2B1hcP1dLbZF-L-%3DznyNFHzfZk53w%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
我找了一篇帖子 主要讲如何在django 中使用ajax 来实现前端和后端的通信。
可以参考一下这篇帖子
https://blog.csdn.net/IqqIqqIqqIqq/article/details/52160662
当然这篇帖子中有一部分内容是中文。但是代码逻辑是相同的。

Translate:
I found an article, that mainly teaches the backend and frontend between
Django and Ajax. Although the article is in mandarin, but the logic of the
code is there and same. You can view it as a reference.

-- 
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/CAPcVkjh2pb6dFitCOJp0zYc8SoUffsrx-_nAHc7TRj7WZ6XT8A%40mail.gmail.com.


Re: Error arises again and again\

2019-08-01 Thread Lim Kai Wey
他说,他要在他社交网站弄个 用户关注

-- 
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/CAPcVkjgO-W-SM9KXMAkUU77NLMUddn0Yh1Dr-at7aNyCQetsLg%40mail.gmail.com.


Re: Writing your first Django app, part 1 - Can't Follow it

2019-08-01 Thread Lim Kai Wey
I do agree that you Sammy could try changing the mysite/mysite/setting.py

  INSTALLED_APPS=[
'polls.apps.PollsConfig',
 
   The rest of the code
  """
   ]

And I too was wondering if he placed 'polls/' as his URL in
mysite/polls/urls.py that cause the error. (IF that is the case)
But in my opinion, for future development purposes and good practice to
know which django app you are at while browsing at webpage.
Remain the mysite/mysite/urls.py as it is. The code should be:

from django.contrib import admin
from django.urls import include, path

urlpatterns = [
path('polls/', include('polls.urls')),
path('admin/', admin.site.urls),
]

and instead change the mysite/polls/urls.py The code should be:

from django.urls import path
from . import views

urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
]

Please do correct me if I am wrong. Hope it helps.

Regards,
Kai Wey

On Thu, Aug 1, 2019 at 6:17 PM Franck Tchouanga 
wrote:

> I wanted to precise at the level of the syntax from what I wrote above
>
>  Urlpatterns = [
>
>   Path(' ',include('polls.URLs')),
>   Path('admin/', admin.site.urls),
>]
>
> --
> 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/a79f2408-a229-4048-a859-bda8e0675e9e%40googlegroups.com
> .
>

-- 
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/CAPcVkji72KQ7Cqq89xKJKnghQWDKsJ12Sc4SUH4qpSQtUiJVrQ%40mail.gmail.com.


Re: Writing your first Django app, part 1 - Can't Follow it

2019-08-01 Thread Lim Kai Wey
Besides that, I do recommend Morzilla's Django Tutorial too, as it covers
more in the tutorial compared to Django's own tutorial.

Link:
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website


Regards,
Kai Wey

On Thu, Aug 1, 2019 at 6:35 PM Lim Kai Wey  wrote:

> I do agree that you Sammy could try changing the mysite/mysite/setting.py
>
>   INSTALLED_APPS=[
> 'polls.apps.PollsConfig',
>  """"
>The rest of the code
>   """
>]
>
> And I too was wondering if he placed 'polls/' as his URL in
> mysite/polls/urls.py that cause the error. (IF that is the case)
> But in my opinion, for future development purposes and good practice to
> know which django app you are at while browsing at webpage.
> Remain the mysite/mysite/urls.py as it is. The code should be:
>
> from django.contrib import admin
> from django.urls import include, path
>
> urlpatterns = [
> path('polls/', include('polls.urls')),
> path('admin/', admin.site.urls),
> ]
>
> and instead change the mysite/polls/urls.py The code should be:
>
> from django.urls import path
> from . import views
>
> urlpatterns = [
> path('', views.IndexView.as_view(), name='index'),
> ]
>
> Please do correct me if I am wrong. Hope it helps.
>
> Regards,
> Kai Wey
>
> On Thu, Aug 1, 2019 at 6:17 PM Franck Tchouanga 
> wrote:
>
>> I wanted to precise at the level of the syntax from what I wrote above
>>
>>  Urlpatterns = [
>>
>>   Path(' ',include('polls.URLs')),
>>   Path('admin/', admin.site.urls),
>>]
>>
>> --
>> 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/a79f2408-a229-4048-a859-bda8e0675e9e%40googlegroups.com
>> .
>>
>

-- 
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/CAPcVkjiSOhVSGpUYBSfAAo%2BLXdRrR6_k3-ydjXu76ZatsbNmZQ%40mail.gmail.com.


Re: Writing your first Django app, part 1 - Can't Follow it

2019-08-01 Thread Lim Kai Wey
Glad it all worked out. Good luck at your journey.

-- 
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/CAPcVkjifx9H-OGXzyq1q9V4DX9z3pz36O3mwmxMKbnQ7wN%3Dh_A%40mail.gmail.com.


3D Object Interaction

2019-08-21 Thread Lim Kai Wey
Greetings,

I would like to ask if anyone has a suggested way for creating a 3D object
which can be interacted with on Django. Any suggestions are welcomed.

Thanks in advance.

Regards,
Kai Wey

-- 
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/CAPcVkjhqYxmDt4x_Px2UHeq49XZss7sh3JOR1JVAHMOL8jaX1A%40mail.gmail.com.


3D Object Interaction

2019-08-23 Thread Lim Kai Wey
Greetings,

I would like to ask if anyone has a suggested way for creating a 3D object 
which can be interacted with on Django.
Any suggestions are welcomed.

Thanks in advance.

Regards,
Kai Wey 

-- 
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/0122874a-5d05-4872-9d40-396431cd9b34%40googlegroups.com.


Re: 3D Object Interaction

2019-08-24 Thread Lim Kai Wey
To Thiago,

No I certainly have not. Thank you for the recommendation, I’ll check it
out.

Regards,
Kai Wey

-- 
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/CAPcVkjj0yrPn2GY6ows_hiPXBFTtYVZ1M16R9c7m1je-6_dW3Q%40mail.gmail.com.


Re: Please help me in views.py

2019-09-04 Thread Lim Kai Wey
Hey Amit,

I suggest you to follow this tutorial to build your project,
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website

It teaches you all the basics that you need to know from scratch, which in
my opinion will answer all the questions you're asking.
The tutorial is about building a local library webpage which I believe is
very similar to what you are doing now.

Hope this helps.

Regards,
Kai Wey

On Wed, Sep 4, 2019 at 3:59 PM Amit Samanta  wrote:

> now how can i get the name for author and details??
>
> On Wed, 4 Sep, 2019, 10:25 AM Bhoopesh sisoudiya, 
> wrote:
>
>> Hi Amit,
>>
>> You can use
>> =≠=
>> Book.objects.select_related(FK).select_related(FK). values (select
>> column name which you want).all()
>>
>>
>> Thanks
>> Bhoopesh sisoudiya
>>
>> On Wed, Sep 4, 2019, 9:38 AM Amit Samanta 
>> wrote:
>>
>>> Hi,
>>>
>>> I need help i am not understanding the keywords of joining and fetch
>>> value in veiw.py
>>> i have three tables in model.py
>>>
>>> Table 1(Author) :
>>>
>>> Table 2(books):
>>>
>>> Table 3 (details):
>>> FK of table1
>>> FK of table2
>>>
>>> Fk = foreign key
>>>
>>> I have to just show
>>>
>>> Author (author name) Books (dynamic) Books(author 2nd book)
>>>  ...
>>> details(dynamic) details(dtl
>>> of author 2nd book) ...
>>>
>>> I have created the template
>>>
>>> now in views.py i an confused
>>>
>>> book=books.object(i do not get what to do)
>>> Author= (same )
>>> details = (same)
>>>
>>> Please can anybody help that will be very greatfull.
>>> Thank you in advance
>>>
>>>
>>>
>>> Thanks and Regards
>>> Amit Samanta
>>>
>>> --
>>> 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/54483cc3-eadd-4559-8c61-c179cfbab933%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> 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/CAAk3c1OzGXKSQg8GK1C8_5Ck-iQ%2B1WjsYMdD%2B%2B0_q3inb94jyw%40mail.gmail.com
>> 
>> .
>>
> --
> 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/CAP4hbAY%3DvOB%2BEs6hZ77jcAU_-LuuG51LkqEPU3eB5nrgqS48ow%40mail.gmail.com
> 
> .
>

-- 
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/CAPcVkjg11EAf-rYFvoz85Y5BLKBisD4FJQSOCzonzi0TFC91ZQ%40mail.gmail.com.


Re: calling index.html

2019-09-28 Thread Lim Kai Wey
Greetings Müller,

In order for your template to load for that specific page, you have to
state it under that page’s view in views.py

Eg:
class IndexView():
   template_name = “index.html”

// Or if it’s a function view

def index(request):

return render(request, 'app/index.html', context)


Hope it helps!

Sincerely,
Kai Wey

-- 
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/CAPcVkjioujw_kbhP9tnT3RZqZi5_cs3W7eU66MNirGeg%3DDo6-A%40mail.gmail.com.


Re: calling index.html

2019-09-28 Thread Lim Kai Wey
Note: Nonetheless, you should read more about the documentation or the
tutorials available since everything you need to start you first Django
project is already there.

-- 
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/CAPcVkjg5Y1MR0i0g1y0ON0DvU7MWsJ04iNc6uOw4yz1VT1MiaQ%40mail.gmail.com.


Changing Queryset into String

2020-01-24 Thread Lim Kai Wey
Greetings everyone,

I would like to ask if anyone knows how to convert my  queryset into string 
or if there is a better approach to what I am trying to accomplish. In 
theory, I am trying to assign all the text into a variable and tokenize the 
whole string so that I can find the top 10 most common word.

Following is the snippet of my code:

Models.py
class Tweet(models.Model):
tweet_id = models.BigIntegerField()
text = models.TextField()
polarity = models.DecimalField(decimal_places=5,max_digits=6,null=True)
keyword = models.ForeignKey(Keyword, on_delete=models.CASCADE)
country = models.CharField(max_length=255,null=True)
stored_at = models.DateTimeField(editable= False)

def __str__(self):
return self.text


Views.py
def tweet_visualizer(request, word = None):
if(word == None):
num_comments = Tweet.objects.all().count()
latest_comments = Tweet.objects.all().order_by('-stored_at')[:6]
all_tweets = Tweet.objects.all()

all_comments = all_tweets.__str__()
tokenized_text = word_tokenize(all_comments)
fdist = FreqDist(tokenized_text)
top_10_common = fdist.most_common(10)
else:
num_comments = Tweet.objects.filter(keyword__keyword=word).count()
latest_comments = Tweet.objects.filter(keyword__keyword
=word).order_by('-stored_at')[:6]
all_tweets = Tweet.objects.filter(keyword__keyword=word)

all_comments= all_tweets.__str__()
tokenized_text = word_tokenize(all_comments)
fdist = FreqDist(tokenized_text)
top_10_common = fdist.most_common(10)


My Current Output:
, , , , , , 
, , 
, , 
, , , , 
, , , 

My Desired Output:
Just each machine team recognize Card shoulder option majority with green 
conference Sometimes feel news chance either ... etc

Thank you in advance for anyone who can help me. I really do appreciate it! 

Sincerely,
Kai Wey

-- 
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/75799a61-843e-4508-abb7-28c379972ebb%40googlegroups.com.