Re: Django URL dispacher

2017-06-03 Thread Domagoj Kovač
Yes, you are right. Sometimes i get the idea in my head that after some thought actually does not make sense :). I would just add product prefix, this is a good solution. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Django URL dispacher

2017-06-03 Thread Domagoj Kovač
I must admin my second example is not that valid. Because i would actually do it like this: 1. on /about-us route - display about us page 2. on /news/ route - display news list page - list pages would finish with the slash - so i would not have that problem. But lets say there is not slash on

Django URL dispacher

2017-06-03 Thread Domagoj Kovač
Hi Everybody, I have a question. Lets say i have two routes routes like this: url(r'^(?P[\w-]+)/$', views.view_article_category, name="article-category"), url(r'^(?P[\w-]+)/$', views.view_product_category, name="product-category"), Lets say that i have a article_category called news and

Re: Django multiple application with common users

2015-03-16 Thread Domagoj Kovač
te: > > Hi, > > Am Mon, 16 Mar 2015 01:23:22 -0700 (PDT) > schrieb Domagoj Kovač <docto...@gmail.com >: > > I would like to have separate databases for every application > > including user management. > > I can think of: > > (a) You put all the applicati

Django multiple application with common users

2015-03-16 Thread Domagoj Kovač
Hi everybody, I have a question. I am working on a series of small home apps for me and my family. I have application like: - cost management - application where i track all my income and costs - market research - application that i use for market researc - food management -

# in django URL

2014-08-14 Thread Domagoj Kovač
Hi Guys, I have a problem, i have url like: http://127.0.0.1:8000/get-file?file_path=/home/domagoj/pcap/#1/test.txt where file_path is path to the file both requestGET["file_path"] and request.get_full_path() ignore #1/test.txt part, how can i fix this? Is there some other way to get full

using revers inside @user_passes_test

2014-07-15 Thread Domagoj Kovač
Hi Guys, I have a problem. I have web application that supposed to have two logins, one for admin other for regular users. Inside my backend i am using @user_passes_test decorator to allow access only to admins. This is my code: my_view > from django.core.urlresolvers import reverse > from

Re: Custom user model backend

2014-05-29 Thread Domagoj Kovač
I already know about SESSION_COOKIE_AGE. I set it to be 30 minutes, but the problem is that even if i am doing something system logs me out, and this should not happen. It work properly before i implemented custom auth backend. -- You received this message because you are subscribed to the

Custom user model backend

2014-05-28 Thread Domagoj Kovač
Hi guys, I extended base user model with certain fields. My code is as follows: #!/usr/bin/env python > # -*- coding: utf-8 -*- > from django.utils import timezone > from django.conf import settings > from django.contrib.auth.backends import ModelBackend > from django.core.exceptions import

Re: Django app called operator

2014-05-08 Thread Domagoj Kovač
Thanks Tom, i thought something like this has happened. -- 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

Django app called operator

2014-05-08 Thread Domagoj Kovač
Hi everybody, I have a problem. In my settings i have: INSTALLED_APPS = ( > 'django.contrib.auth', > 'django.contrib.contenttypes', > 'django.contrib.sessions', > 'django.contrib.sites', > 'django.contrib.messages', > 'django.contrib.staticfiles', > # Uncomment the

Re: Class that extends a model that is not a model

2014-03-06 Thread Domagoj Kovač
Thanks Havier, Proxy models also look like something that fit my needs. -- 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: Class that extends a model that is not a model

2014-03-05 Thread Domagoj Kovač
Thanks Tom, this looks like something that can help me. Thanks! -- 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

Re: Class that extends a model that is not a model

2014-03-05 Thread Domagoj Kovač
I did not try that, and i don't think this would help. Separation to more files doesn't have anything to do with the way works, theoretically your whole code can be just one file. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Class that extends a model that is not a model

2014-03-05 Thread Domagoj Kovač
Hi Guys, I have a model called Calculation, this model has fields that are calculated and saved to the database, this model also hold some common calculation functions. I also have two other classes TrailerCalculation and TruckCalculation they both calculate values of the fields that will be

Re: Dynamic queries

2013-10-30 Thread Domagoj Kovač
Thanks Tom, I deleted my question because i find an answer in the meantime. I am having a problem with ForeignKey values, it would be cool to search trough them. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group

Dynamic query with Foreign Key

2013-10-30 Thread Domagoj Kovač
Hi guys, I have a question. I have a a code like this: where model_object is an instance of an Model. for field in model_object._meta.fields: field_type = type(field) if field_type is not AutoField and \ field.name != "created" and \

Dynamic queries

2013-10-30 Thread Domagoj Kovač
Hi guys, I would like to have dynamic query. For example i have a query like: rows_list = model_object.objects.not_deleted() query = Q(name__contains=search_term) query |= Q(equipment_manufacturer__name__contains=search_term) rows_list = rows_list.filter(query)

Common fields auto values

2013-10-23 Thread Domagoj Kovač
Hi guys, I have a question. I am working on an application that i can use as a starting point for my future projects. I have a core application that has CommonFields abstract model defined as: from django.db import models from django.contrib.auth.models import User class

Re: DJANGO and SOAP

2013-10-16 Thread Domagoj Kovač
I actually need a client library, not server library. -- 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

DJANGO and SOAP

2013-10-16 Thread Domagoj Kovač
Hi everyone, I have a problem. For the past few days i have been looking for some good SOAP client library and i did not found anything that works properly. The problem is that i have some recursive SOAP function and as i saw, suds has the problem with this types of things, some other

Re: Remove validation on a field if its empty

2013-09-05 Thread Domagoj Kovač
Thanks man! I did not see your post in time so i did this in clean method. This is a bit of a hack, your way is much cleaner. Thanks one more time! def clean(self): super(UserForm, self).clean() if self.instance.pk: password = self.cleaned_data.get("password")

Remove validation on a field if its empty

2013-09-05 Thread Domagoj Kovač
Hi guys, i am working on user CRUD. I am using one form for user creation and update. When user is initially created it is ok to perform password validation - users must have password, but in my edit form i want to have a logic like: when nothing is entered don't do anything, when user enters