Exception Value: (1048, "Column 'active_year_id' cannot be null")

2019-10-20 Thread Rain
Hello Guys Hopefully someone can help me on this.! any help i appreciate it.

My Problem is This.. I do my research and still cant figure out what the 
solution for this..!
i do Try alot of things but still cant get this right. 
what i want is to populate the active_year_id. automatically when 
submitting the form..
Thanks in Advance...


My Model Look Like This:
And My Views Look Like This..

-- 
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/53f9c9b6-fdb5-4a1a-b2b0-2ef384bd82a5%40googlegroups.com.


Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Thanks Sir Alot sir ima check for it!

On Fri, Oct 18, 2019 at 9:55 AM Okware Aldo  wrote:

> hello,
> You could use signals pre_save
> https://docs.djangoproject.com/en/2.2/topics/signals/
>
>
> On Fri, Oct 18, 2019 at 4:49 AM Rain  wrote:
>
>> Hello!. thanks for your help..
>> what i want to achieve is ti check if end year is already meet.
>> then if school year already ended. The field would be inactive or the
>> boolean True would be False.
>> if the set year already passed.
>>
>> On Fri, Oct 18, 2019 at 4:41 AM James Gutu  wrote:
>>
>>> It depends what you are trying to achieve.
>>> What do you mean by "then when school year end  this would automatically
>>> in_active"?
>>> Do you need to determine start_date <= self.end_year *only when saving*
>>> or you need to check *everyday* to see if datetime.now() >
>>> self.end_year?
>>>
>>> On Thu, Oct 17, 2019 at 4:27 PM Rain  wrote:
>>>
>>>> Hi Guys!! Hope Fully someone can help me any hint or answer really
>>>> appreaciated..
>>>> ireally stuck here in a couple of days now.
>>>> My Problem is i want to set a school year using
>>>> start_year and end_year field then when school year end  this would
>>>> automatically in_active
>>>> for example
>>>> start_year: 2019-01-01
>>>> end_year: 2020-01-01
>>>> active_year: True
>>>>
>>>> then when 2020-01-01 ends
>>>> the boolean will automatically change the status to
>>>> active_year:False
>>>>
>>>> --
>>>> 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/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/django-users/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>
>>>
>>> --
>>>
>>> --
>>> Regards,
>>> James Gutu
>>> Mobile: +447368461508
>>> Skype: jmgutu
>>>
>>> --
>>> 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/CAOnWGOLqLHhZeo9brsWuVNipaOX3yyxuW%2BN22tq7xbe_XEg7hA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/django-users/CAOnWGOLqLHhZeo9brsWuVNipaOX3yyxuW%2BN22tq7xbe_XEg7hA%40mail.gmail.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/CAM-q_1cE%2Bpstaxti72smp%3DfEzgGqV0oCbjp14C17x%3DfwnKnhug%40mail.gmail.com
>> <https://groups.google.com/d/msgid/django-users/CAM-q_1cE%2Bpstaxti72smp%3DfEzgGqV0oCbjp14C17x%3DfwnKnhug%40mail.gmail.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/CAMEZma-bceR0T3GwULj%3DW3ojs1gyu-qVYXaYgEifoZHiDjMuyw%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAMEZma-bceR0T3GwULj%3DW3ojs1gyu-qVYXaYgEifoZHiDjMuyw%40mail.gmail.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/CAM-q_1cQUPGxBfY2k2eWNrx4AU_X_yDFECSU4PEv50sZ2fAFLw%40mail.gmail.com.


Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Hello!. thanks for your help..
what i want to achieve is ti check if end year is already meet.
then if school year already ended. The field would be inactive or the
boolean True would be False.
if the set year already passed.

On Fri, Oct 18, 2019 at 4:41 AM James Gutu  wrote:

> It depends what you are trying to achieve.
> What do you mean by "then when school year end  this would automatically
> in_active"?
> Do you need to determine start_date <= self.end_year *only when saving*
> or you need to check *everyday* to see if datetime.now() > self.end_year?
>
> On Thu, Oct 17, 2019 at 4:27 PM Rain  wrote:
>
>> Hi Guys!! Hope Fully someone can help me any hint or answer really
>> appreaciated..
>> ireally stuck here in a couple of days now.
>> My Problem is i want to set a school year using
>> start_year and end_year field then when school year end  this would
>> automatically in_active
>> for example
>> start_year: 2019-01-01
>> end_year: 2020-01-01
>> active_year: True
>>
>> then when 2020-01-01 ends
>> the boolean will automatically change the status to
>> active_year:False
>>
>> --
>> 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/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>
>
> --
>
> --
> Regards,
> James Gutu
> Mobile: +447368461508
> Skype: jmgutu
>
> --
> 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/CAOnWGOLqLHhZeo9brsWuVNipaOX3yyxuW%2BN22tq7xbe_XEg7hA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAOnWGOLqLHhZeo9brsWuVNipaOX3yyxuW%2BN22tq7xbe_XEg7hA%40mail.gmail.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/CAM-q_1cE%2Bpstaxti72smp%3DfEzgGqV0oCbjp14C17x%3DfwnKnhug%40mail.gmail.com.


set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Hi Guys!! Hope Fully someone can help me any hint or answer really 
appreaciated..
ireally stuck here in a couple of days now.
My Problem is i want to set a school year using
start_year and end_year field then when school year end  this would 
automatically in_active
for example
start_year: 2019-01-01
end_year: 2020-01-01
active_year: True

then when 2020-01-01 ends 
the boolean will automatically change the status to
active_year:False

-- 
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/e429d5d2-a6fc-4bf1-82b0-1c12e08f3f49%40googlegroups.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
Thanks Alot. its just my  code editor not reading it. appreciate your
Help..!!

On Thu, Oct 10, 2019 at 6:55 PM wd  wrote:

> hi,
>
> I didn't think django template tags are relevant with script or any html
> code. They are totally different things.
> I think it's just your code editor didn't recognize the tags, have you
> tried ignore them and see if django will report an error ?
>
> On Thu, Oct 10, 2019 at 6:22 PM Rain  wrote:
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CABexzmgjJLFD4YTE1jCE22a-SBb%3DdSLJKw0suzSOB86WnSRrgQ%40mail.gmail.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/CAM-q_1fdro7%3D9Mh8ZcWEkmXO3x3t3idGXWUHq8%3DLY%3DRyT0h7PQ%40mail.gmail.com.


Re: Django Template Tags not working inside script

2019-10-10 Thread Rain
its totally fine now its just my code editor not reading it thanks for your
help. Appreciated..!!

On Thu, Oct 10, 2019 at 7:04 PM Andréas Kühne 
wrote:

> Hi,
>
> This is completely vaid, as long as you use a render method to render the
> html file. It shouldn't be a problem. How do you include this in your html
> page?
>
> Regards,
>
> Andréas
>
>
> Den tors 10 okt. 2019 kl 12:22 skrev Rain :
>
>> I want to add an for each method in inside script but for some reason
>> django template tags not working in this case only.
>> can someone please help me ! thanks alot
>>
>>
>>
>>
>> --
>> 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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com
>> <https://groups.google.com/d/msgid/django-users/6276f8cc-d47f-4d4a-8002-04c5cbff786c%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/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAK4qSCfg37R-W3rYCH3VX%3DPguXoWE2eJABtJCnhOPzMi1xYCkA%40mail.gmail.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/CAM-q_1dtnkniK1s9X7A%2BnTPPJ9pc4gs8aEieiH6CU%2BH7ch7JsQ%40mail.gmail.com.


Django Template Tags not working inside script

2019-10-10 Thread Rain

I want to add an for each method in inside script but for some reason 
django template tags not working in this case only.
can someone please help me ! thanks alot




-- 
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/6276f8cc-d47f-4d4a-8002-04c5cbff786c%40googlegroups.com.


creating school year

2019-09-24 Thread Rain
i have a question how to create school year with start date and end date 
all transaction must under this year. 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/4e3ad7a5-a1c2-4c0d-ae17-57f98f9df975%40googlegroups.com.