Re: New user question: Where to put non-form validation code?

2019-07-25 Thread Matt Zand
 specific bits of additional info are
> >>> also ok.
> >>>
> >>> For example I have a Student model that has name and address
> >>> info.  There is a ManyToMany relation to the Class(es) in which
> >>> that Student is enrolled.  A "student" instance is valid if the
> >>> name and address fields are filled.  A student is "complete" if
> >>> the student is valid and has signed up for one or more classes.
> >>>
> >>> So, my question is: where should the valid and complete methods
> >>> live?  Should they be in the Student model or CBV? Someplace
> >>> else?  Does it matter?
> >>
> >> I like to put that sort of stuff into model methods then add
> >> model.clean() to call them and raise whatever error may be
> >> appropriate if they fail.
> >>
> >>
> https://docs.djangoproject.com/en/2.1/topics/forms/modelforms/#interaction-with-model-validation
> >>
> >> and
> >>
> >>
> https://docs.djangoproject.com/en/2.1/ref/models/instances/#validating-objects
> >>
> >> and
> >>
> >>
> https://docs.djangoproject.com/en/2.1/ref/models/instances/#django.db.models.Model.clean
> >>
> >> You can raise your own errors which inherit from ValidationError
> >> to fine tune the process. For example, I differentiate between
> >> BusinessRuleViolation and InvalidToken and a couple of others
> >> where that delivers better control.
> >>
> >>
> >>>
> >>> Cheers
> >>> --
> >>> 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 todjango-users+unsubscr...@googlegroups.com
> >>> <mailto:django-users+unsubscr...@googlegroups.com>.
> >>> To post to this group, send email
> >>> todjango-us...@googlegroups.com
> >>> <mailto:django-users@googlegroups.com>.
> >>> Visit this group athttps://groups.google.com/group/django-users.
> >>> To view this discussion on the web
> >>> visithttps://
> groups.google.com/d/msgid/django-users/22801669-96ec-4a43-a264-fd50c2544604%40googlegroups.com
> >>> <
> https://groups.google.com/d/msgid/django-users/22801669-96ec-4a43-a264-fd50c2544604%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
> >>> For more options, visithttps://groups.google.com/d/optout.
> >>
> >>
> >> --
> >> 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 todjango-users+unsubscr...@googlegroups.com
> >> <mailto:django-users+unsubscr...@googlegroups.com>.
> >> To post to this group, send email todjango-us...@googlegroups.com
> >> <mailto:django-users@googlegroups.com>.
> >> Visit this group athttps://groups.google.com/group/django-users.
> >> To view this discussion on the web
> >> visithttps://
> groups.google.com/d/msgid/django-users/ajujeafh6d4qa4vvpfv2bxf9.1563085360028%40email.android.com
> >> <
> https://groups.google.com/d/msgid/django-users/ajujeafh6d4qa4vvpfv2bxf9.1563085360028%40email.android.com?utm_medium=email&utm_source=footer
> >.
> >> For more options, visithttps://groups.google.com/d/optout.
> >
> > --
> > 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
> > <mailto:django-users+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/django-users/A2531CD5-E89E-4EB3-84C5-CF6CEB05E53D%40hotmail.com
> > <
> https://groups.google.com/d/msgid/django-users/A2531CD5-E89E-4EB3-84C5-CF6CEB05E53D%40hotmail.com?utm_medium=email&utm_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/485bb1ee-db33-09d3-a3d9-aebf337ade20%40dewhirst.com.au
> .
>


-- 
Cheers,

Matt Zand
Cell: 202-420-9192
Work: 240-200-6131
High School Technology Services <https://myhsts.org/>
DC Web Makers <https://dcwebmakers.com/>
Coding Bootcamps <https://coding-bootcamps.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/CAJHWHyU8H5-02%2BJZ9tZkVz8nzggrjuJ%2Bca5SZVk8ZjVcT4uc%2BA%40mail.gmail.com.


Blog or link sharing in the community page

2019-07-24 Thread Matt Zand
Hi, 

I shared one blog post last week in community section. It does not show up. 
https://www.djangoproject.com/community/

Can someone help me out. My article links was below:
https://myhsts.org/upload-and-process-website-cvs-file-using-python-django.html

and RSS link
https://myhsts.org/rss_feed.xml


-- 
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/4316e3fd-9eb8-4a40-94a4-bff83376dac2%40googlegroups.com.