Sunday, September 2, 2018

Re: text editor

Pycharm is best for Django..

On Sun, Sep 2, 2018, 11:11 AM sankar ardhas <sankarardhas@gmail.com> wrote:

Hi to all,
            Which is the best editor for django framework  in Ubuntu os 18.04




On Sun, Sep 2, 2018 at 1:46 AM +0530, "RONAK JAIN" <jainronak877@gmail.com> wrote:

Namaste !!

Dear ,

I have two models categories and Project.

 created like that :

class Category(models.Model):
    categorys = models.ManyToManyField('Category',blank=True)
    name = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now=False, auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)



    class Meta:
        verbose_name_plural = "Categories"

    def __str__(self):
        return self.name

    def __unicode__(self):
        return self.categorys

class Project(models.Model):
    categorys = models.ManyToManyField('Category',blank=True)
    name = models.CharField(max_length=100)
    description = models.CharField(max_length=100)
    created_at = models.DateTimeField(auto_now=False, auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)
    photo = models.ImageField(upload_to="pictures")


    def __str__(self):
        return self.name

    def __unicode__(self):
        return self.categorys

and Views I did here :

from web.models import Category,Project

class Portfolio(TemplateView):
    template_name = "web/protfolio.html"

    def post(self, request, *args, **kwargs):
        context = self.get_context_data()
        return super(TemplateView, self).render_to_response(context)
    
    def portfolio(request):
          context = RequestContext(request)
          # Project_list = Project.objects.order_by('-likes')[:3]
          # context_dict = {'Project': project_list}
          # return render(template_name, context_dict, context
          brand_list = Category.objects.all()
          return render(template_name, {'brand_list' : brand_list}, context)

I need correct relationship both I mean project and categories. How can I do correct here ? 
Note : I attached picture please analyse briefly.

How to do approch html page and   I want  the html(view) page should load from our db.
please give me quickly answer.
How can i do ?


Thanks
Ronak

--
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+unsubscribe@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/63ecd6f1-411a-4581-b245-296efbd49303%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+unsubscribe@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/39ABAA35669F59A4.eb8de1ab-f7fe-4f09-ac86-ab24def151d1%40mail.outlook.com.
For more options, visit https://groups.google.com/d/optout.

************************************************************************

This e-mail and all attachments are intended solely for use by the intended recipient and may contain confidential / proprietary information of KiwiTech, LLC, subject to important disclaimers and conditions including restrictions on the use, disclosure, transfer or export of such information. If you have received this message in error or are not the named recipient(s), please immediately notify the sender at the telephone number stated above or by reply e-mail and delete this e-mail from your computer

--
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+unsubscribe@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/CAJOHC1zrx7fDp5YQ69mcj6ABfNGYK1CX%2BfPOQ2%3DqDx42rUOvgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment