Re: Error using url in django template language

2017-02-20 Thread chris rose
hey you tried: you app name is links rather than myapp, so try: -- 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

Re: any idea for get_absolute_url in m2m categories

2017-02-20 Thread carlos
thank Melvyn :) i understands right now! On Mon, Feb 20, 2017 at 9:24 AM, Melvyn Sopacua wrote: > On Monday 20 February 2017 08:39:07 carlos wrote: > > > Hi, Melvyn yes i use similar but for the question is > > > the best way? > > > > > > def get_absolute_url(self): > > >

Re: Read Only by user in Django Admin

2017-02-20 Thread Juan Corrales Araya
Hi. The answer is very simple. you have to install *django-admin-view-permission* then you have to added on setting INSTALLED_APPS = [ ... 'admin_view_permission', ... ] finally you have to run:* python manage.py migrate* You will see that the permission will already be

Re: Subquery has too many columns

2017-02-20 Thread eltonplima
Base class is abstract. class Base(models.Model): plano = models.ForeignKey(Plano) class Meta: abstract = True base_manager_name On Saturday, February 18, 2017 at 9:20:03 PM UTC-3, Melvyn Sopacua

Re: Implementing a basic search for my website

2017-02-20 Thread Shawn Milochik
If you want a pre-rolled solution, just use Django-haystack. It'll do exactly what you want. If you want to create your own to avoid the dependency on additional libraries and backend (you'll need something like Elasticsearch), that's easy also. Let me know if you do. I have some sample code

Re: Implementing a basic search for my website

2017-02-20 Thread Melvyn Sopacua
Hi Carlo, On Monday 20 February 2017 07:33:08 Carlo Ascani wrote: > class ASearch(ListView): > model = A > template_name = 'search_result.html' > > def get_context_data(self, **kwargs): > context = super(A, self).get_context_data(**kwargs) > results = A.objects.all()

Re: Implementing a basic search for my website

2017-02-20 Thread ludovic coues
You can split your query set in two. First search elements with both elements then elements with only one. Obviously, that's two request, so there might be better way to handle the problem. On 20 Feb 2017 4:33 p.m., "Carlo Ascani" wrote: > Hi all, > I am just trying to

Re: combining ORM and raw SQL in same query

2017-02-20 Thread Larry Martell
Thanks! On Mon, Feb 20, 2017 at 10:52 AM, m1chael wrote: > i did something like this recently using .extra / select > > https://docs.djangoproject.com/en/1.10/ref/models/querysets/#extra > > > > On Mon, Feb 20, 2017 at 10:49 AM, Larry Martell > wrote:

Django Forum or Pinax Project Forums, and how do they work with user account-project?

2017-02-20 Thread Ronen
Hello, I am new in this forum and hope it’s OK to ask some question here. And I am new to pinax\django\python (I went over some example and tutorials). I want to create a site that contain forums and customize it to my needs. I install Pinax and I have a user account and profile out of the

Re: combining ORM and raw SQL in same query

2017-02-20 Thread m1chael
i did something like this recently using .extra / select https://docs.djangoproject.com/en/1.10/ref/models/querysets/#extra On Mon, Feb 20, 2017 at 10:49 AM, Larry Martell wrote: > Is there any way to use both the ORM and raw SQL in the same query? > > I have an

combining ORM and raw SQL in same query

2017-02-20 Thread Larry Martell
Is there any way to use both the ORM and raw SQL in the same query? I have an existing app that uses the ORM and now I have a need to add SQL like this to the select: (CASE WHEN TRIM(IFNULL(roiname, '')) IN ('', 'None') THEN CONCAT_WS('.', roi_type_id, roi_id) WHEN CONCAT_WS('.',

Implementing a basic search for my website

2017-02-20 Thread Carlo Ascani
Hi all, I am just trying to add a search funcionality to my frontend. I know it is a huge topic, so sorry my n00bih questions. I have a model A class A(models.Model): roles = models.ManyToManyField(B) location = models.ForeignKey(C) ... These 2 fields are the only fields I care

Re: any idea for get_absolute_url in m2m categories

2017-02-20 Thread Melvyn Sopacua
On Monday 20 February 2017 08:39:07 carlos wrote: > Hi, Melvyn yes i use similar but for the question is > the best way? > > def get_absolute_url(self): > > return '/%s/%s-%s/' % (self.categories.all()[0].slug, self.id, > self.slug) #this way a take first category, but other best way to do >

Re: any idea for get_absolute_url in m2m categories

2017-02-20 Thread carlos
Hi, Melvyn yes i use similar but for the question is the best way? def get_absolute_url(self): return '/%s/%s-%s/' % (self.categories.all()[0].slug, self.id, self.slug) #this way a take first category, but other best way to do that? thank for helps :) On Mon, Feb 20, 2017 at 5:06 AM, Melvyn

"Ask the Django Team Anything" IRC session - Wed Feb 22 18:00 UTC

2017-02-20 Thread Tim Graham
In partnership with the freenode community team, the Django team will hold an "Ask Me Anything" session this week. See http://freenode.net/news/django-ama for details. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Django-hotsauce 0.6.6 is out

2017-02-20 Thread Etienne Robillard
Hi guys, I'm glad to announce the release of django-hotsauce 0.6.6. :) This is a stable/bugfix release of django-hotsauce. *What's new** *Core library:* * * New generic model API in notmm.dbapi.orm.model * Imported Django 1.10 management API in notmm.dbapi.orm.management * Updated test

Re: any idea for get_absolute_url in m2m categories

2017-02-20 Thread Melvyn Sopacua
On Sunday 19 February 2017 23:00:54 carlos wrote: > class Category(...): > name = CharField() > slug = SlugField(.) > > class MyModel(modesl.Model): > post = models.CharField() > slug = models.SlugField(.) > categories = models.ManyToMany(Category) > >def