PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Atsunori Kaneshige
Hi Django users, I started using Django recently. I am following the official Django tutorial. I am just at Writing Your First Django App, Part4, and I have been just copying and pasting all codes. But I have a problem in vote. I inserted print(question) and this is printed in detail.html also,

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-02 Thread Atsunori Kaneshige
Oh, one note is that I am using postgresql. everything else except vote function in views.py seems working. Sorry, any help would be really appreciated! Nori On Saturday, February 2, 2019 at 10:02:14 PM UTC-5, Atsunori Kaneshige wrote: > > Hi Django users, > > I started using Dja

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
I have this database named as Koitaro in my posgresql* question has data, but choice thing doesn't seem having any data... I really appreciate your thoughts. Nori On Sunday, February 3, 2019 at 1:56:18 AM UTC-5, Nitin Kalmaste wrote: > > Have you migrated database and added a

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
On Sunday, February 3, 2019 at 10:22:56 AM UTC-5, Atsunori Kaneshige wrote: > > Hi Nitin, > > Thank you for your comment. > > I did > > jango-admin startproject mysite > > and cd mysite, then > > python manage.py runserver > > and server is workin

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
f we need any joins for concrete inheritance cases (the FieldError: Cannot resolve keyword 'question_pub_date' into field. Choices are: choice_text, id, question, question_id, votes In [36]: c = q.choice_set.filter(choice_text__startswith='Just hackin')) File "", li

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
q.choice_set.create(choice_text='Just hacking again',votes=0) In [32]: c.question Out[32]: In [33]: q.choice_set.all() Out[33]: , , ]> In [34]: q.choice_set.count() Out[34]: 3 choice exits, or correctly working? Nori On Sunday, February 3, 2019 at 10:55:48 AM UTC-5,

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
tabase > like the process is same as you used for the questions. > On Sun, Feb 3, 2019, 8:53 PM Atsunori Kaneshige wrote: > >> Hi Nitin, >> >> Thank you for your comment. >> >> I did >> >> jango-admin startproject mysite >> >> and

Re: PLEASE HELP! Django documentation, Writing Your First App, Part 4

2019-02-03 Thread Atsunori Kaneshige
.all()) > > # Or, a bit more verbose, for example: > for c in question.choice_set.all(): > print(c.pk, c) > > # Is the following a valid PK among the choices printed above? > print(request.POST['choice']) > > Best regards, > Cars

columns were not added/created to my database table (postgresql) after makemigrations/migrate

2019-02-05 Thread Atsunori Kaneshige
Hi, Django masters! My app has simple models.py just two fields like below. #models.py class List(models.Model): item = models.CharField(max_length=200) completed = models.BooleanField(default=False) #migration 0001 class Migration(migrations.Migration): initial = True dependencies = [

Re: columns were not added/created to my database table (postgresql) after makemigrations/migrate

2019-02-05 Thread Atsunori Kaneshige
d python's magic method in order to return something from > the models you have created. Also you have to register your models to > admin.py file. You can refer Django documents for that. > > On Wed, Feb 6, 2019, 8:03 AM Atsunori Kaneshige wrote: > >> Hi, Django ma

Question about form_valid: how to automatically set multiple fields when users input data via CreateView supported form?

2019-04-27 Thread Atsunori Kaneshige
I really appreciate if anybody could give me an advice about form_valid. Here is what I want to do. I am making a simple blog. I am making simple features: 1) only superuser can create articles. 2) logged-in users can make comments to articles. I followed along tutorials and mostly done. *But las

Re: Question about form_valid: how to automatically set multiple fields when users input data via CreateView supported form?

2019-04-27 Thread Atsunori Kaneshige
/Koitaro/.local/share/virtualenvs/MMBlog-58h299OP/lib/python3.6/lib-dynload', '/Applications/anaconda3/lib/python3.6', '/Users/Koitaro/.local/share/virtualenvs/MMBlog-58h299OP/lib/python3.6/site-packages'] Server time: Sat, 27 Apr 2019 21:24:45 + On Saturday, April 2

Re: Question about form_valid: how to automatically set multiple fields when users input data via CreateView supported form?

2019-04-27 Thread Atsunori Kaneshige
? Where is the user information? I successfully can access to user by self.request.user, but currently I have no idea how to access to article information. Sorry, any advice I can try would be really appreciated! Looking forward to hearing advice. Best regards, Nori On Saturday, April 27, 2019 a

Re: Question about form_valid: how to automatically set multiple fields when users input data via CreateView supported form?

2019-04-28 Thread Atsunori Kaneshige
n to test first also a >> supporting forms.py now commented it. >> form_valid function working fine after added **kwargs parameter. >> >> You could always use a requirements file while sharing code files. For >> that use pip freeze > requirements.txt command.

Re: Question about form_valid: how to automatically set multiple fields when users input data via CreateView supported form?

2019-04-29 Thread Atsunori Kaneshige
hed zip for the comments version. Added comments to context of >> ListView then displayed it in template. >> Always think about Function Based View first then convert it to Class >> Based View, it would help you learn well. >> >> >> Regards >> Britto >> >

Django, Markdownx, image upload from admin after deployment

2020-05-02 Thread Atsunori Kaneshige
Hi, everyone, I have a problem in uploading image from admin site of my simple blog. Everything works fine locally. *I implemented Markdownx and I can drag and drop images into new blog in admin.* The uploaded images from admin site are stored in media/markdownx folder as expected. I did deploym

Re: Django, Markdownx, image upload from admin after deployment

2020-05-02 Thread Atsunori Kaneshige
Hi, Yashwanth, Thank you for your reply. I watched it, but this is nothing to do with markdownx. I implemented markdownx, https://github.com/neutronX/django-markdownx. This is working properly locally and I can upload images by drag&drop in my admin site. *However, I cannot drag and drop images