Reporting unwanted behaviours

2018-01-17 Thread Kubilay Yazoğlu
Hi. I want to implement a reporting system in which users report a post simply by clicking the report button and later on, admins check it whether the post is really against the policy of the website. However, when I make a research about Django Reporting Systems, the results are not related t

How to send parameter to view?

2017-12-18 Thread Kubilay Yazoğlu
Hello. I have two apps. Posts and Contests. In templates/contest/detail.html, there is a button that takes you to templates/post/create.html What I want is to send the contest name from detail to create so that the post will be added to the right contest. For that, I guess I should do somethin

Unresolved filter 'crispy'

2017-12-04 Thread Kubilay Yazoğlu
I'm trying to add crispy forms to my project. (http://django-crispy-forms.readthedocs.io/en/latest/) I installed crispy forms by pip install django-crispy-forms I added this in installed apps: 'crispy_forms', And this at the end of settings.py: CRISPY_TEMPLATE_PACK = 'bootstrap3' A

Problem when trying to display field name on admin panel

2017-12-01 Thread Kubilay Yazoğlu
Hello. It gives error when I click on my app name in admin panel because of the "ratings" field. Without it, it loads fine. Error: KeyError at /admin/photo/photo/ 'manager' Error during template rendering In template C:\Users\Root\Desktop\PhotashBackend\sanal\lib\site-packages\django\contrib

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-28 Thread Kubilay Yazoğlu
gt; > On Mon, Nov 27, 2017 at 7:58 PM, Kubilay Yazoğlu . > wrote: > >> Oh, that's a life saver information. Thanks. I edited my code. >> Unfortunately, only thing that has changed is the name of the error which >> looks like this right now: NOT NULL constraint faile

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu .
ciate your help. On Tue, Nov 28, 2017 at 1:32 AM, Matemática A3K wrote: > > > On Mon, Nov 27, 2017 at 7:30 PM, Matemática A3K > wrote: > >> >> >> On Mon, Nov 27, 2017 at 7:18 PM, Kubilay Yazoğlu >> wrote: >> >>> Nice try but I'm still

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Nice try but I'm still getting this error: IntegrityError at /photo/create/ NOT NULL constraint failed: photo_photo.contest_id_id I tried with both 'contest': random_item and 'contest_id': random_item.contest_id. (I don't know why you wrote contest instead of contest_id. Field name is contest

Re: NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
at to Django. If > photo_id is the PK of Photo, don't set it, Django will on save. > > If the same goes for Contest, then do a "contest = Contest()" - create a > new contest - and assign it to the photo "photo.contest = contest", then > "photo.sav

NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Hi. I'm trying to create a form to construct an object for my Photo class. All of the objects fields except the photo itself will be invisible to the user. So, the only thing can be seen in the form is the button to select and upload the photo. There is no problem with creating the form page. T

NOT NULL constraint failed when trying to create form with initial values

2017-11-27 Thread Kubilay Yazoğlu
Hi. I'm trying to create a form to construct an object for my Photo class. All of the objects fields except the photo itself will be invisible to the user. So, the only thing can be seen in the form is the button to select and upload the photo. There is no problem with creating the form page. T

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
Thanks. I was talking about the composite primary keys in my second question. I've seen that there is a library for it. So, no problem now. Thank you. 27 Kasım 2017 Pazartesi 23:31:29 UTC+3 tarihinde Matemática A3K yazdı: > > > > On Mon, Nov 27, 2017 at 10:50 AM, Kubilay

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
Thanks. I was talking about the composite primary keys in my second question. I've seen that there is a library for it. So, no problem now. Thank you. 27 Kasım 2017 Pazartesi 01:49:15 UTC+3 tarihinde Kubilay Yazoğlu yazdı: > > Hello. I have two models. In one of them, I declared a

Re: How to select the proper column when I use ForeignKey?

2017-11-27 Thread Kubilay Yazoğlu
thod of the object, > define it to your needs in A :) > > On Sun, Nov 26, 2017 at 7:49 PM, Kubilay Yazoğlu > wrote: > >> Hello. I have two models. In one of them, I declared a foreign key to the >> other one. Since this is done in Django by only specifying the Class

How to select the proper column when I use ForeignKey?

2017-11-26 Thread Kubilay Yazoğlu
Hello. I have two models. In one of them, I declared a foreign key to the other one. Since this is done in Django by only specifying the Class name, without specifying the field name(column name), when I try to create an object in admin panel, it pulls the wrong column information. Two models A

Re: How to define a url that does not belong to any app?

2017-11-26 Thread Kubilay Yazoğlu
asım 2017 Pazar 02:00:25 UTC+3 tarihinde Kubilay Yazoğlu yazdı: > > Hi there. I have only one week of experience in Django, some things aren't > clear to me yet. > > I want to create a page where users can access by clicking on a button in > homepage. > Since this page contains pl

How to define a url that does not belong to any app?

2017-11-25 Thread Kubilay Yazoğlu
Hi there. I have only one week of experience in Django, some things aren't clear to me yet. I want to create a page where users can access by clicking on a button in homepage. Since this page contains plain text and there is no functionality in it, it does not have be in any of the apps. But si