Re: How to call the super class instance variables in sub class in python3

2018-10-04 Thread daniel main
Use the super() builtin function. It returns an object that has the ability
to instantiate your parent class. see  sample code:

class Animal(object):
def __init__(self,*args,**kwargs):
pass
 #print(types,'Base class with Animal')
class Mammal(Animal):
   def __init__(self):
   super().__init__('Child classs for mammal')
   print('Child Class for mammal')

m = Mammal()

The output:
usr/bin/python3.6 /home/bug/PycharmProjects/pydummies/graphics/one.py
Child Class for mammal

Process finished with exit code 0
Thanks.






On Wed, 3 Oct 2018 at 17:43,  wrote:

> how i can call super class instance varibles in subclass (python3)
>
> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/f6a92d85-7311-4f7a-8460-185a51b20154%40googlegroups.com
> 
> .
> For more options, visit https://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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8LdZbF1XM2ByxCgSZq3R7mCSSCVvLz-MfiDqbhS%3DuqdqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: I put 3 more fields on database models

2018-10-06 Thread daniel main
Hello. Try and make the migrations then migrate. I hope that helps

On Oct 7, 2018 01:03, "Bleron Uka"  wrote:

Hi,
My database has data there and i add 3 more inputs and i am having this
error ?!

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/9d3c91cd-7568-417e-98eb-f38325a38120%40googlegroups.com

.
For more options, visit https://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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8KtoanDkZW8HTovhG1k_cWSz_VK2%3Djzhn2i9ePkp9emgA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-11 Thread daniel main
Hello,
Have you tried adding an app_name = 'your_app_name' in the URLs.py file?
Thanks

On Oct 12, 2018 09:36, "Glen D souza"  wrote:

> Hi,
>
> Try after name-spacing url patterns i.e
>
> app_name = 'blog'
>
> urlpatterns = [
> path('', PostListView.as_view(), name='blog-home'),
> path('user//', UserProfileListView.as_view(), name=
> 'user-profile' ),
> path('user//posts/', UserPostListView.as_view(), name=
> 'user-posts'),
> path('user//posts/view/', UserProfilePostListView.
> as_view(), name='user-posts-view'),
> path('post//', PostDetailView.as_view(), name='post-detail'),
> path('post//comment/', views.add_comment, name='add-comment'),
> path('post/new', PostCreateView.as_view(), name='post-create'),
> path('post//edit/', PostUpdateView.as_view(), name='
> post-update'),
> path('post//delete/', PostDeleteView.as_view(), name=
> 'post-delete'),
> path('about/', views.about, name='blog-about')
> ]
>
> https://docs.djangoproject.com/en/2.1/topics/http/urls/#
> naming-url-patterns
>
>
> On Fri, 12 Oct 2018 at 12:02, Manjunath  wrote:
>
>> Try adding for action to your add_comment url  then submit the form.
>> I guess currently form is getting submitted in the same page.
>>
>> On Friday, October 12, 2018 at 12:00:03 PM UTC+5:30, Robert CR wrote:
>>>
>>> here is the template file.
>>>
>>> *add_comment.html*
>>>
>>>
>>>
>>> *{% extends "blog/base.html" %}{% load crispy_forms_tags %}{% block
>>> content %}{%
>>> csrf_token %}  >> class="border-bottom mb-4">Comment  {{ form|crispy }}
>>> Post Comment!
>>>   {% endblock content %}*
>>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/aeaadfcb-38b7-4db2-9921-1c8c2485fd5e%
>> 40googlegroups.com
>> 
>> .
>> For more options, visit https://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.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHfehoVJDE5aGBgfHk1pJJ_ffZoMwuOx3vengZNdmjxfsNSktg%
> 40mail.gmail.com
> 
> .
> For more options, visit https://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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8%2BWQv-TUpRgJQ8rLGmUXSGbMTyEPGG%2B%2ByTv%3DydJ9_BoFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Blog app Error: NoReverseMatch at /post/14/

2018-10-12 Thread daniel main
Use id instead of pk

On Oct 12, 2018 10:34, "Glen D souza"  wrote:

>
> *def add_comment(request, slug):*
> *post = get_object_or_404(Post, slug=slug)*
> *if request.method == 'POST':*
> *form = CommentForm(request.POST)*
> *if form.is_valid():*
> *comment = form.save(commit=False)*
> *comment.post = post*
> *comment.save()*
> *return redirect('blog:post_detail', slug=post.slug)*
> *else:*
> *form = CommentForm()*
> *template = 'blog/add-comment.html'*
> *context = {*
> *'form': form*
> *}*
> *return render(request, template, context)*
>
> Check this view, it has an argument called slug and from your url you are
> passing parameter to that slug argument i.e path('post//
> comment/', views.add_comment, name='add-comment')
> In this case slug field will contain the id of the post i believe,
>
> If you check this *post = get_object_or_404(Post, slug=slug), **slug
> field contains the id but your post model does not an attribute called slug
> so what you should really do is*
> *post = get_object_or_404(Post, id=slug) **or you can rename the url as *
> path('post//comment/', views.add_comment, name='add-comment') and
> your view as
> *def add_comment(request, id):*
> *post = get_object_or_404(Post, id=id)*
> *if request.method == 'POST':*
> *form = CommentForm(request.POST)*
> *if form.is_valid():*
> *comment = form.save(commit=False)*
> *comment.post = post*
> *comment.save()*
> *return redirect('blog:post_detail', slug=post.slug)*
> *else:*
> *form = CommentForm()*
> *template = 'blog/add-comment.html'*
> *context = {*
> *'form': form*
> *}*
> *return render(request, template, context)*
>
> On Fri, 12 Oct 2018 at 12:56, Robert CR  wrote:
>
>> If i do that i get another error:
>>
>> [image: Udklip2.PNG]
>>
>> --
>> 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 post to this group, send email to django-users@googlegroups.com.
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/django-users/769a8b8a-53d8-43fe-9caa-908cc6fc0204%
>> 40googlegroups.com
>> 
>> .
>> For more options, visit https://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.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/CAHfehoXQbi948m6-NOgeNvEUj4AWTZxcjjt0wShEO7-
> ajfgeFw%40mail.gmail.com
> 
> .
> For more options, visit https://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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8JeWX0ER0YFdwH_Ewkc195%3D7pRzVJHUte4LT7Orep8%2Bvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Network analysis tool

2018-10-25 Thread daniel main
Hello. I want to create a network troubleshooting tool that runs on a web
interface. How efficient is Django channels. Are there alternatives? Thank
you

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8LZoCfrDgurp7F8KqPveDyydpchHgraF_%3DbLbeVcvXgLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Network analysis tool

2018-10-26 Thread daniel main
Thanks for the reply. I want to create an interface that will visualize the
TCP and UDP dump data and also a section showing the upload and download
speeds

On Oct 27, 2018 04:52, "Ryan Nowakowski"  wrote:

> It depends on what you want to do. If you want to use websockets then
> channels is a great choice.
>
> If you want to have long running background processes then channels is
> good for most things. Alternatively, Celery is a bit more mature and
> full-featured.
>
> On October 25, 2018 3:21:58 AM CDT, daniel main 
> wrote:
>>
>> Hello. I want to create a network troubleshooting tool that runs on a web
>> interface. How efficient is Django channels. Are there alternatives? Thank
>> you
>>
>> --
> 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 post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/954250CC-64FD-45CE-B998-A8479F572B2A%40fattuba.com
> <https://groups.google.com/d/msgid/django-users/954250CC-64FD-45CE-B998-A8479F572B2A%40fattuba.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://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.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAEEZZ8%2B75ZNM_QqsYWiWgz3i_K_mPsfy-oVVORj4eouyJTsgmw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.