Re: Security issue in django.db.models

2020-08-08 Thread Stephen J. Butler
If you look at the documentation for 'blank' it says:

"""
Note that this is different than null. null is purely database-related,
whereas blank is validation-related. If a field has blank=True, *form
validation* will allow entry of an empty value. If a field has blank=False,
the field will be required.
"""

So that is only caught when doing form validation, not when doing model
validation.


On Fri, Aug 7, 2020 at 6:46 AM Juan D.  wrote:

> I've created a model with null and blank set to False in robot_name:
>
> class Robot(models.Model):
> robot_name = models.CharField(max_length=200, null=False, blank=False)
> version = models.CharField(max_length=20, blank=True, null=True)
>
> class Meta:
> unique_together = ('robot_name', 'version',)
>
> On the admin website everything works perfectly and I am not allowed to
> create a robot without a name. However, on the shell:
>
> Robot.objects.create(version="test_version")
>
> doesn't raise any Exception.
>
> What could it be?
>
> --
> 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/4ff1570e-70a2-495c-82e3-f20d760992d2n%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/CAD4ANxV3r35zB70M4D6s_35PuxUeYay5JQUFuPOfJAA6vovBxQ%40mail.gmail.com.


Re: ERROR

2020-08-08 Thread Kovy Jacob
Are you switching into your projects directory and then using 'python
manage.py runserver' from command prompt/terminal to run your website?

On Sat, Aug 8, 2020 at 4:25 PM Agoua David  wrote:

> Can you send a screenshot of the view file
>
> Le sam. 8 août 2020 à 20:21, traore arouna  a écrit :
>
>> Hello
>> I am here because I am developing an e-commerce application.
>> But at a certain level of my code when I run my server with the command
>> python manage runserver
>> I have an error message
>> Uncaught ReferenceError: info is not defined
>>
>> --
>> 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/2fdbf0c6-5f2e-4120-a524-6f3171c50389o%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/CAByCr6gT6SJ1EHyDMTGKb6Q73rbRJXWnd7XbgOeq7WE%2BLU3sAg%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/CACMwF3U_6LtFunxAm%2BoSjPFuAYyFGQ7QsgctyigqJXCathe8Lw%40mail.gmail.com.


Gstreamer

2020-08-08 Thread Amar prakash
Any code for how to use gstreamer in Django?

-- 
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/f4446d19-8f6f-46b1-96a6-19391d5c6304o%40googlegroups.com.


Re: Django jinja queryset filter lenth

2020-08-08 Thread Agoua David
As Django template engine do not support the parenthèses you Can try to
make a custom filter

Le sam. 8 août 2020 à 20:27, Agoua David  a écrit :

> You Can try to use .count instead
>
> Le sam. 8 août 2020 à 17:56, N'BE SORO  a écrit :
>
>> Good evening please
>>
>> Can you help me?
>>
>> I want to display the number of items with a filter.
>> Example:
>> this call returns 4 elements
>> {{ item.class.classecours.all|length}}
>>
>> at the .all level
>> make an item.class.classecours.filter(status==True)|length
>>
>> --
>> 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/CAOtSHp_wH9Xy-sf9t%2BMdtWB-bnRX680R9iJwZAnyZXh%3DxV%3De%3Dg%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/CAByCr6iR%2BKojR-csC3Rv5zqYd7mUG4%2B%2BnvEcM_ebZmM%2BceRmsw%40mail.gmail.com.


Re: Django jinja queryset filter lenth

2020-08-08 Thread Agoua David
You Can try to use .count instead

Le sam. 8 août 2020 à 17:56, N'BE SORO  a écrit :

> Good evening please
>
> Can you help me?
>
> I want to display the number of items with a filter.
> Example:
> this call returns 4 elements
> {{ item.class.classecours.all|length}}
>
> at the .all level
> make an item.class.classecours.filter(status==True)|length
>
> --
> 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/CAOtSHp_wH9Xy-sf9t%2BMdtWB-bnRX680R9iJwZAnyZXh%3DxV%3De%3Dg%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/CAByCr6gpLTbsL3OsCBkfWT6pHgg-XCvhm4sY%3D_y4E5raZucdXA%40mail.gmail.com.


Re: ERROR

2020-08-08 Thread Agoua David
Can you send a screenshot of the view file

Le sam. 8 août 2020 à 20:21, traore arouna  a écrit :

> Hello
> I am here because I am developing an e-commerce application.
> But at a certain level of my code when I run my server with the command
> python manage runserver
> I have an error message
> Uncaught ReferenceError: info is not defined
>
> --
> 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/2fdbf0c6-5f2e-4120-a524-6f3171c50389o%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/CAByCr6gT6SJ1EHyDMTGKb6Q73rbRJXWnd7XbgOeq7WE%2BLU3sAg%40mail.gmail.com.


ERROR

2020-08-08 Thread traore arouna


Hello
I am here because I am developing an e-commerce application.
But at a certain level of my code when I run my server with the command
python manage runserver
I have an error message
Uncaught ReferenceError: info is not defined

-- 
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/2fdbf0c6-5f2e-4120-a524-6f3171c50389o%40googlegroups.com.


Re: Python-django project

2020-08-08 Thread learn code
Thank you all for your interest!!!

On Fri, Aug 7, 2020 at 2:18 PM Anu Pande  wrote:

> Interested.
>
> On Fri, Aug 7, 2020, 21:09 hajar Benjat  wrote:
>
>> Interested
>>
>> On Tue, Jul 21, 2020, 4:10 AM learn code  wrote:
>>
>>> Hi everyone,
>>>
>>> I am learning python and django, like to work on the projects to improve
>>> more.If any one interested to join with me to work on the projects,plz send
>>> me a email.
>>>
>>> --
>>> 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/e7116e9b-9458-4f49-a638-135c4b5874e0o%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/CAMcj6WfU0_0g4qdV8LqqOVo7Lrad7HipL7QDG%3Dxc4ZTx7OHHWQ%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/CAFWCH_rtLhqDvrJf0UCeB2PfLj-cZRzy4xtNgZkVFo-k8XJ1Bg%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/CAPUBRGUKRwmCqGoDOTjbHQzSEu3ip9FBWrgse2dkjPAg1ncmrA%40mail.gmail.com.


Django jinja queryset filter lenth

2020-08-08 Thread N'BE SORO
Good evening please

Can you help me?

I want to display the number of items with a filter.
Example:
this call returns 4 elements
{{ item.class.classecours.all|length}}

at the .all level
make an item.class.classecours.filter(status==True)|length

-- 
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/CAOtSHp_wH9Xy-sf9t%2BMdtWB-bnRX680R9iJwZAnyZXh%3DxV%3De%3Dg%40mail.gmail.com.


Re: How to populate fields generated by modelformset_factory with data from database

2020-08-08 Thread Integr@te System
Hi Micheal,

https://docs.djangoproject.com/en/3.0/topics/forms/formsets/


You see in doc with example such as custom queryset, initial data get from
existed instances all base on your design and codebase.


On Sat, Aug 8, 2020, 10:48 PM Michael Klassen  wrote:

> Hi, thank you for your response but I need some more specifics.  My
> queryset includes the questions which the form presents to the user.  How
> do I get their responses included in the queryset?  Do I have to somehow
> join tables to get both questions and responses?  If I follow the
> relationships in the queryset, I see that I can filter and find the
> responses, but how do I get Django to fill the form fields with the
> responses?
>
> Thank you!
>
> On Friday, August 7, 2020 at 10:24:21 AM UTC-4, Integr@te System wrote:
>>
>> Hi Michael,
>>
>> You can read queryset combine with model in modelformset_factory() method
>> to get exact user and/or any fields you need as existed instance or base on
>> cookies or sth like that to identify your user, depend on your use case(ex
>> trigger events or choose one option...). Hope it helpful.
>>
>>
>>
>> On Fri, Aug 7, 2020, 6:46 PM Michael Klassen  wrote:
>>
>>> Hello:
>>>
>>> I am using modelformset_factory to generate my form based on a model.
>>> If the user submits a page, then returns to it later, I would like to
>>> populate the fields with what they previously answered.  I can only find
>>> examples of pre-populated fields with the extra forms; is there a way to do
>>> this with the first form?
>>>
>>> Thank you.
>>>
>>> --michael
>>>
>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/django-users/75f5f32d-64f7-4a90-a34e-8d1717ff2828o%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/ec084248-7c27-468a-90a3-c2bf5bc3fc20o%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/CAP5HUWr1EbtJfeqFhWhWvNfj4Lq8sWKuMLT5qmkKugfd%2B3qO-Q%40mail.gmail.com.


Re: Flask to django

2020-08-08 Thread Miracle
You'll have to build a brand new application using django.

Django and flask are quite similar, so porting to django won't be so much
issue.
Also, both work with python.

However, there's no automatic way to change from flask to django. You'll
have to write the codes. And it's not totally a big deal.

If you face any challenges when building a new django application, we'll be
here to help.

On Sat, 8 Aug 2020, 4:15 pm Mottaz Hegaze,  wrote:

> no
>
> On Sat, Aug 8, 2020 at 4:22 PM sakshi jain  wrote:
>
>> hello
>>
>> On Sat, Aug 8, 2020, 19:31 Amar prakash  wrote:
>>
>>> Anyway to transform my flask code to django
>>>
>>> --
>>> 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/d7f28744-33bc-4c3b-9e93-4eb827b0554do%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/CAJhs3iO9-Fv_y8_77uxSnJgzmHOWJsrhuSMyNt25jChNUoCyFg%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/CAHV4E-c-%3DTWtEyaJ_sChyuRs8LP_eWcszLszZXzyTHpL7U8iSg%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/CADZv-jAfa_-7p7tq9idPhu%2BnisjPFjJRhFzk5-C7GzeUqwYuRw%40mail.gmail.com.


Re: How to populate fields generated by modelformset_factory with data from database

2020-08-08 Thread Michael Klassen
Hi, thank you for your response but I need some more specifics.  My 
queryset includes the questions which the form presents to the user.  How 
do I get their responses included in the queryset?  Do I have to somehow 
join tables to get both questions and responses?  If I follow the 
relationships in the queryset, I see that I can filter and find the 
responses, but how do I get Django to fill the form fields with the 
responses?

Thank you!

On Friday, August 7, 2020 at 10:24:21 AM UTC-4, Integr@te System wrote:
>
> Hi Michael,
>
> You can read queryset combine with model in modelformset_factory() method 
> to get exact user and/or any fields you need as existed instance or base on 
> cookies or sth like that to identify your user, depend on your use case(ex 
> trigger events or choose one option...). Hope it helpful.
>
>
>
> On Fri, Aug 7, 2020, 6:46 PM Michael Klassen  > wrote:
>
>> Hello:
>>
>> I am using modelformset_factory to generate my form based on a model.  If 
>> the user submits a page, then returns to it later, I would like to populate 
>> the fields with what they previously answered.  I can only find examples of 
>> pre-populated fields with the extra forms; is there a way to do this with 
>> the first form?
>>
>> Thank you.
>>
>> --michael
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/75f5f32d-64f7-4a90-a34e-8d1717ff2828o%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/ec084248-7c27-468a-90a3-c2bf5bc3fc20o%40googlegroups.com.


Re: Flask to django

2020-08-08 Thread Mottaz Hegaze
no

On Sat, Aug 8, 2020 at 4:22 PM sakshi jain  wrote:

> hello
>
> On Sat, Aug 8, 2020, 19:31 Amar prakash  wrote:
>
>> Anyway to transform my flask code to django
>>
>> --
>> 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/d7f28744-33bc-4c3b-9e93-4eb827b0554do%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/CAJhs3iO9-Fv_y8_77uxSnJgzmHOWJsrhuSMyNt25jChNUoCyFg%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/CAHV4E-c-%3DTWtEyaJ_sChyuRs8LP_eWcszLszZXzyTHpL7U8iSg%40mail.gmail.com.


Re: Flask to django

2020-08-08 Thread sakshi jain
hello

On Sat, Aug 8, 2020, 19:31 Amar prakash  wrote:

> Anyway to transform my flask code to django
>
> --
> 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/d7f28744-33bc-4c3b-9e93-4eb827b0554do%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/CAJhs3iO9-Fv_y8_77uxSnJgzmHOWJsrhuSMyNt25jChNUoCyFg%40mail.gmail.com.


Flask to django

2020-08-08 Thread Amar prakash
Anyway to transform my flask code to django

-- 
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/d7f28744-33bc-4c3b-9e93-4eb827b0554do%40googlegroups.com.