Re: Django error while running

2023-03-21 Thread oba stephen
Can you share the content of your settings file? The installed apps in particular... On Tue, 21 Mar 2023, 16:05 Chandresh . T, wrote: > Recently I was running a git clone ( > https://github.com/divanov11/StudyBud.git) > > after doing required steps like migrations, etc. I started to run it by >

Re: DRF | Django | Up votes | Down Votes

2021-06-24 Thread oba stephen
Hi, One way would be to create an extra field to track the difference in both fields and then in your meta information on that model set the ordering to that field. Another approach which is better is to do something like this. Votes.objects.extra(select={'diff': 'upvote - downvote'}).order_by('

Re: Chaining filter is not working

2021-03-30 Thread oba stephen
Also you need to assign a related name to the foreign key for that filter to work. Best regards Stephen Oba On Tue, Mar 30, 2021, 1:58 PM Saurabh Ahire wrote: > Please check the model class also , if there are any mistakes point them > out > > -- > You received this message because you are sub

Re: Chaining filter is not working

2021-03-30 Thread oba stephen
You didn't equate to anything. You have to specify what quality you are filtering by. Best regards Stephen Oba On Tue, Mar 30, 2021, 1:58 PM Saurabh Ahire wrote: > Please check the model class also , if there are any mistakes point them > out > > -- > You received this message because you are

Re: Checkout my new Project CryptographicFields

2020-09-18 Thread oba stephen
Nice On Fri, Sep 18, 2020 at 2:32 PM Shahprogrammer wrote: > Hi guys, I have build an open source project for using cryptography in > Django Models . It allows by-directional encryption. > Here is the link :- Django-CryptographicFields >

Re: How remove "__all__" from the beginnings of form error messages?

2020-08-03 Thread oba stephen
Alright, Nice to know. Cheers. On Mon, Aug 3, 2020 at 7:12 PM Christian Seberino wrote: > I figured out the problem...If you only want the "global" errors to show > up at the top of the form > then you need to use {{form.non_field_errors}} instead of {{form.errors}}. > > > -- > You received thi

Re: How remove "__all__" from the beginnings of form error messages?

2020-08-03 Thread oba stephen
Hi, could you share your forms.py, your views.py and the template. On Mon, Aug 3, 2020 at 2:22 PM Christian Seberino wrote: > I created a custom form error messag like so... > > raise django.forms.ValidationError("Invalid date") > > However, when I do {{form.errors}} in a template I see thi

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
Good to know.. Cheers! On Fri, Jul 31, 2020 at 7:21 AM Dinolin yp job wrote: > Thanks a lot @obastephen it worked. > > On Friday, July 31, 2020 at 12:32:47 AM UTC+5:30 obast...@gmail.com wrote: > >> irst in your UploadSerializer fields use fields = "__all__" >> >> Then you can use this in your

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
irst in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
first in your UploadSerializer fields use fields = "__all__" Then you can use this in your views: *def post(self, **request, format=None**):* *upload_file = request.data.get("upload_file"**)* *upload_date = **request.data.get("upload_date"**)* *user = request.user

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
You can create an upload form with an Image field, then when saving the for set the User field to request.user. Do you have an UploadForm already in your forms.py? if yes, show me with the view that handles. On Thu, Jul 30, 2020 at 11:59 AM Dinolin yp job wrote: > > > It worked but user_id colu

Re: Django3 runserver error

2020-07-30 Thread oba stephen
Also try using a virtual environment. On Thu, Jul 30, 2020 at 10:52 AM Haris Ahmad wrote: > Hi there, > Resolved_path =pathlib.path.resolve(strict=True) > > Use this, might work.. > > On Thu, 30 Jul 2020, 2:25 PM Mira, wrote: > >> Hi All, >> I recently upgraded Django from 2.2 to 3 on my MacOS1

Re: IntegrityError: null value in column "user_id" violates not-null constraint

2020-07-30 Thread oba stephen
>From the error, it states that you are trying to add an upload object to the database without a user. And from your model.py, the User foreign key does not have a null=True, and blank=True. So you can't save a null value for that user field. On Thu, Jul 30, 2020 at 10:52 AM Dinolin yp job wrote:

Re: HOW TO REDIRECT DIFFERENT CATEGORY OF USERS THROUGH LOGIN REDIRECT (two login redirects instead of one)

2020-07-11 Thread oba stephen
parate temple for that view? >> >> >> On Sat, Jul 11, 2020, 10:41 PM oba stephen wrote: >> >>> You can consider redirecting to a URL that handles the request. >>> >>> That is a View function that checks if the user is a student or teacher, >>&

Re: HOW TO REDIRECT DIFFERENT CATEGORY OF USERS THROUGH LOGIN REDIRECT (two login redirects instead of one)

2020-07-11 Thread oba stephen
You can consider redirecting to a URL that handles the request. That is a View function that checks if the user is a student or teacher, then renders the respective profiles. Regards On Sat, Jul 11, 2020 at 5:58 PM Kuntal Paul wrote: > The *LOGIN_REDIRECT_URL* only allowing to redirect to a p

Re: how to change the format of datetimefield model

2020-07-08 Thread oba stephen
See if this might help https://blog.ipswitch.com/date-formatting-in-python#:~:text=To%20do%20that%2C%20I'd,day%2C%20month%20and%20year%20is. see full documentation here https://docs.python.org/3.4/library/datetime.html#strftime-and-strptime-behavior On Wed, Jul 8, 2020 at 5:01 PM Chander shekhar

Re: Can someone help me??

2020-07-01 Thread oba stephen
#x27;blog:detail', kwargs={'pk':self.id}) >>> >>> def body_to_markdown(self): >>> return markdown.markdown(self.content.replace("\r\n", ' >>> \n'),extensions=[ >>> 'markdown.extensions.extra

Re: Can someone help me??

2020-07-01 Thread oba stephen
Can you share your models.py? Like Sencer said you have to check data types where the "+" operator is used. On Thu, Jul 2, 2020 at 3:55 AM Hella Nick wrote: > Dear Mir oba stephen: > > I deleted "volume" function,But The result is the same. > >

Re: Can someone help me??

2020-07-01 Thread oba stephen
The Error is straight forward, you are using an operand "+" for two two data types that it can't be used on. This might be from your "volume" function. On Wed, Jul 1, 2020 at 9:30 AM Hella Nick wrote: > Can someone help me?? > > > My project catalogue: > > > My setttings: > > TEMPLATES = [ >

Re: Required Django programmers for HR Portal project

2020-06-27 Thread oba stephen
Would be interestef On Sat, Jun 27, 2020 at 8:57 PM maninder singh Kumar < maninder.s.ku...@gmail.com> wrote: > Dear group subscribers, > > I require Django programmers for an HR Job portal. It is an intern > project. > > regards willy > >

Re: TemplateDoesNotExist

2019-09-23 Thread oba stephen
Try using "./base.html" I believe this should do it. On Mon, Sep 23, 2019, 1:40 PM yerri swamy wrote: > Hi guys, > > By using templates folder i am not getting what i am expecting and > i am getting error 'Template Does Not Exist' ,and also defaulty it's not > coming templates variable

Re: manage.py runserver error

2019-09-22 Thread oba stephen
Did you use "python manage.py runserver" or just "manage.py runserver"? On Sun, Sep 22, 2019, 5:09 AM Pawan Jha wrote: > When I run the Command "manage.py runserver" on the command > prompt(WINDOWS), I get the following error: > Traceback (most recent call last): > File "C:\Documents and Setti