Re: A query question

2013-02-26 Thread ozgur yilmaz
the db backend and the number of column you can add an index on > fielddate ( check explain output to see if it's useful since it depends on > db backend/ dbengine/structure of the table to make it 'inexpensive' ) > > ~ Ronan > > > On Tue, Feb 26, 2013 at 9:59 AM, ozgur yilmaz

Re: A query question

2013-02-26 Thread ozgur yilmaz
, activity_date__lte = specific_end_date ) a_objects = A.objects.exclude( kisi__in = b_objects ) Is it enough? 2013/2/26 carlos <crocha09...@gmail.com>: > Hi, maybe use DateField__range(date1,date2) > > Cheers > > > On Tue, Feb 26, 2013 at 5:43 AM, ozgur yilmaz &

A query question

2013-02-26 Thread ozgur yilmaz
Hi all, I have to build a query, if possible an inexpensive query: Model A: ... ... Model B: ForeignKey( Model A ) Date ... Model B is an activity with a date field. I want to find which Model A objects didnt join an activity between specific dates. What are the appropriate ways to find this

Re: A question about template fragment caching

2013-02-16 Thread ozgur yilmaz
Thank you for information:) 2013/2/16 Christophe Pettus <x...@thebuild.com>: > > On Feb 16, 2013, at 9:16 AM, Christophe Pettus wrote: > >> >> On Feb 16, 2013, at 8:50 AM, ozgur yilmaz wrote: >> >>> I'm using template fragment caching in my project. I

A question about template fragment caching

2013-02-16 Thread ozgur yilmaz
Hi all, I'm using template fragment caching in my project. I'm wondering what the view function do when template fragment caching is active? Are queries in the view function be executed? Or bypass the queries and read the cached fragment? Thanks, -- You received this message because you are

A problem about get_absolute_url()

2012-11-12 Thread ozgur yilmaz
Hi all, I have 4 classes and i want to build a get_absolute_url() for a class, querying other 3 classes. But i get "list index out of range" error for the FILTER row. Any ideas? class Aaa( models.Model ): ... ... class City( models.Model ): ... ... class Bbb( models.Model ): aaa

Re: How to build this query

2012-11-09 Thread ozgur yilmaz
Maybe: paris_discounts = Discount.objects.filter( brand__shop__city__name = 'Paris' ).distinct('id') What do you think? 2012/11/9 ozgur yilmaz <yelb...@gmail.com>: > But Brand doesnt have a city field. Shop class has a city field. > > 2012/11/9 Jirka Vejrazka <jirka.

Re: How to build this query

2012-11-09 Thread ozgur yilmaz
that your City has an attribute "name". > > HTH > > Jirka > > > > On Fri, Nov 9, 2012 at 9:12 AM, ozgur yilmaz <yelb...@gmail.com> wrote: >> >> Hi all, >> >> I hope i can explain my query problem well. Think you have 3 classe

How to build this query

2012-11-09 Thread ozgur yilmaz
Hi all, I hope i can explain my query problem well. Think you have 3 classes: class City( models.Model ): ... ... class Brand( models.Model ): ... ... class Shop( models.Model ): brand = models.ForeignKey( Brand ) city = models.ForeignKey( City ) ... ... class Discount( models.Model ):

Re: Django Development environment

2011-08-22 Thread ozgur yilmaz
Windows XP and windows 7. Notepad++. Mysql. South. 2011/8/23 Shawn Milochik : > On 08/22/2011 06:07 PM, Stephen Jackson wrote: >> >> I am new to the world of Django. I would like to hear from other django >> developers describe their dev environment (tools, os, editors, etc.).

Re: dynamic form with popup

2011-08-22 Thread ozgur yilmaz
Thanks Shawn, I think i satisfied with this way. It seems a suitable way for Django. I'll use it. Thanks again, 2011/8/23 Shawn Milochik <sh...@milochik.com>: > On 08/22/2011 05:44 PM, ozgur yilmaz wrote: >> >> Ok. Thank you so much. So, formset is a su

Re: dynamic form with popup

2011-08-22 Thread ozgur yilmaz
times, to add multiple product? Is it a common way? Thanks again, 2011/8/23 Shawn Milochik <sh...@milochik.com>: > On 08/22/2011 05:33 PM, ozgur yilmaz wrote: >> >> thanks, >> >> but i think i have to use a suitable js for adding a new product. am i >>

Re: dynamic form with popup

2011-08-22 Thread ozgur yilmaz
thanks, but i think i have to use a suitable js for adding a new product. am i wrong? 2011/8/23 Shawn Milochik <sh...@milochik.com>: > On 08/22/2011 05:21 PM, ozgur yilmaz wrote: >> >> thats not the answer. you can add item to basket by clicking a button >> "add t

Re: dynamic form with popup

2011-08-22 Thread ozgur yilmaz
ı <yasar11...@gmail.com> yazdı: > I don't know the answer, but you may want to check this > out: http://www.satchmoproject.com/ > > 2011/8/23 ozgur yilmaz <yelb...@gmail.com> >> >> Hi, I have a problem. >> >> I have two models: >> >> cla

dynamic form with popup

2011-08-22 Thread ozgur yilmaz
Hi, I have a problem. I have two models: class CheckOut(models.Model): models.DateField() class Product(models.Model): checkout = models.ForeignKey( CheckOut ) name = models.CharField() price = models.FloatField() With these models, i want to contruct a CheckOut form, and select

Start to get error after modifying models

2011-08-05 Thread ozgur yilmaz
Hi, After i modified some models, i started to get following errors: Traceback (most recent call last): File "C:\Python26\lib\site-packages\django\core\servers\basehttp.py", line 280, in run self.result = application(self.environ, self.start_response) File

Re: howto remove request.GET parameter

2011-06-02 Thread ozgur yilmaz
I realized that, there's nothing wrong with the removing code. The problem is the return statement. when the dictionary req is empty the def returns u"" and somehow old request.GET remains unchanged. So i should return a specific value, when the dictionary req is null. 2011/6/2 ozgur yi

howto remove request.GET parameter

2011-06-02 Thread ozgur yilmaz
Hi, I have a custom templatetag function like this: @register.filter(name='rem_get_request') def rem_get_request(getrequest,name): req = getrequest.copy() for get_item in name.split('&'): if get_item in req and req[get_item]: get_item =

Re: nested template tags

2011-05-27 Thread ozgur yilmaz
at yet but could be worth a shot. > > https://docs.djangoproject.com/en/1.3/ref/templates/builtins/#with > > > On Thu, May 26, 2011 at 9:08 AM, ozgur yilmaz <yelb...@gmail.com> wrote: >> Hi, >> >> I want to use an expression like this: >> >&

Re: nested template tags

2011-05-26 Thread ozgur yilmaz
TemplateSyntaxError at /the/url/ qstring_set requires 1 arguments, 0 provided 2011/5/26 Nikhil Somaru <nsom...@gmail.com>: > Could you detail the error raised when you visit the page? > > On Thu, May 26, 2011 at 12:38 PM, ozgur yilmaz <yelb...@gmail.com> wrote: >>

nested template tags

2011-05-26 Thread ozgur yilmaz
Hi, I want to use an expression like this: {{ i }} The first {{ i }} is in another tag. is there any way to manage this problem? Thanks, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: change extension of uploaded image

2011-04-15 Thread ozgur yilmaz
) 2011/4/15 ozgur yilmaz <yelb...@gmail.com>: > Hi, > > I want to change the filetype of any uploaded image to JPG. What is > the most efficient way for this? I think i surely do this before > save(). Any ideas? > > Thanks, > -- You received this message because

change extension of uploaded image

2011-04-15 Thread ozgur yilmaz
Hi, I want to change the filetype of any uploaded image to JPG. What is the most efficient way for this? I think i surely do this before save(). Any ideas? Thanks, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
No suggest? 2011/2/7 ozgur yilmaz <yelb...@gmail.com> > Hi, > > I'm using file caching. But need to increment a field for storing product > hits. Is there an optimal way to do this? > > Thanks, > -- You received this message because you are subscribed to the Google G

incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
Hi, I'm using file caching. But need to increment a field for storing product hits. Is there an optimal way to do this? Thanks, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to know if is a update or insert??

2011-02-04 Thread ozgur yilmaz
try: old_user = User.objects.get(pk=self.pk) # means update except: pass 2011/2/4 andmart > Hi, > > I overrided the save_model of ModelAdmin of model Client that is > associated a one User so I can create a user when a client is created. > > Well, how to know if

Re: Help on adding CSS to django project

2011-02-04 Thread ozgur yilmaz
In your template: In your urls.py: site_media = os.path.join(os.path.dirname(__file__),'site_media') urlpatterns = patterns('', (r'^site_media/(?P.*)$' , 'django.views.static.serve',{'document_root':site_media}), ) Maybe helps... 2011/2/4 h@ck5t0ck > Hi

Re: Charfield, limiting acceptable characters

2011-02-04 Thread ozgur yilmaz
yilmaz <yelb...@gmail.com> > Maybe RegexValidator can solve this problem. But i couldnt manage to use > it: > > from django.core.validators import RegexValidator > alias = models.CharField( max_length = 100, unique = True, > validators=[RegexValidator('[a-z]')] ) > > &

Re: Charfield, limiting acceptable characters

2011-02-04 Thread ozgur yilmaz
Maybe RegexValidator can solve this problem. But i couldnt manage to use it: from django.core.validators import RegexValidator alias = models.CharField( max_length = 100, unique = True, validators=[RegexValidator('[a-z]')] ) 2011/2/4 ozgur yilmaz <yelb...@gmail.com> > Yes, i know o

Re: Charfield, limiting acceptable characters

2011-02-04 Thread ozgur yilmaz
Yes, i know overriding field cleand method, but i couldnt get a start point for character match code. 2011/2/4 Shawn Milochik <sh...@milochik.com> > > On Feb 4, 2011, at 2:47 PM, ozgur yilmaz wrote: > > It was possible in the past with validator_list. Like: > > re

Re: Charfield, limiting acceptable characters

2011-02-04 Thread ozgur yilmaz
It was possible in the past with validator_list. Like: regex = r'^[A-z][\w-]{2,31}$' name = models.CharField(max_length=32, unique=True , validator_list=[validators.MatchesRegularExpression(regex)] ) But with what code to override the clean method? Is there any sample or built in function for

Charfield, limiting acceptable characters

2011-02-04 Thread ozgur yilmaz
Hi there, I want to limit the characters for a charfield with [a-z\-] (characters from a to z (lowercase) and '-' ) Is there any way you know? Thanks, -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: django using wrong python???

2010-12-30 Thread ozgur yilmaz
I have Centos, and it comes with python2.4(sorry, not 2.5). I installed python2.6 and django is under: /usr/lib/python2.4/site-packages/django /usr/lib/python2.6/site-packages/django i defined alias in bash_profile, so when i give "python" command from shell, python2.6 works... 2010/12/30

django using wrong python???

2010-12-30 Thread ozgur yilmaz
Hi, I'm on centos and have two pythons 2.5 and 2.6. I tried in models.py: from fractions import Fraction and got the error: No module named fractions But when i use shell and type "from fractions import Fraction" it's OK, it uses python2.6 installation. How can i modify django installation

Model Formset Pre-Filled Problem

2010-12-23 Thread ozgur yilmaz
Hi, I'm trying to use model formsets. At first, everything is normal. But when i open the form page for the second time, i see that the formset is pre-filled with the previous values. Here is my code: models.py --- class FooModel( models.Model ): a_field =

www prefix in sitemap.xml

2010-12-14 Thread ozgur yilmaz
Hi, I'm using sitemap with django. But because of the django_site config in DB, sitemap.xml displays domain without WWW prefix. If i use PREPEND_WWW = True, when i use IP address in browser, the setting prepend www to the IP, so address looks like: www.11.111.11.111. Is there any solution

Re: django admin css problem

2010-12-02 Thread ozgur yilmaz
admin/media/" 2010/12/2 ozgur yilmaz <yelb...@gmail.com>: > Hi, > > Yesterday i moved my site to a linux solution. Everything is going > fine, except admin site. When i go to url example.com/admin, the > template doesnt work. When i look at the source, i see these: >

django admin css problem

2010-12-02 Thread ozgur yilmaz
Hi, Yesterday i moved my site to a linux solution. Everything is going fine, except admin site. When i go to url example.com/admin, the template doesnt work. When i look at the source, i see these: But i dont have any urls or files on example.com/media/css/base.css or

minimum system requirements

2010-10-31 Thread ozgur yilmaz
Hi, I'm developing a project by django 1.2.3. Now it's time to bring the project to production. I'm looking for dedicated servers but i dont know the minimum hardware requirements. There are dedicated options with P4 cpus. Is there any information about requirements? Thanks all, -- You

template problem with login.html

2010-09-17 Thread ozgur yilmaz
Hi, I built a site with django. Now i have a stupid (i couldnt understand) problem. Everything works perfect but when i try to login and registration/login.html is rendered, there is a margin at the top of the login.html. And the font size increases 1 or 2 points. Font family and other css