Re: constraining one model's attributes with another's

2012-04-12 Thread Jani Tiainen
> I hope this is clear. > > Many thanks for your help. > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group,

Re: Django Book

2012-04-12 Thread Jani Tiainen
Btw, you can checkout book as a SVN from http://djangobook.com/svn/trunk/en/ Maybe we, as a community could import that to bitbucket/github and continue maintaining it? On Thu, Apr 12, 2012 at 5:10 PM, Timothy Makobu wrote: > > > On Thu, Apr 12, 2012 at 3:45 PM,

Re: DB queries at import time

2012-04-12 Thread Jani Tiainen
and it will be evaluated at the runtime: class MyForm(forms.Form): foo=forms.ChoiceField(choices=mychoices) -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@goog

Re: Django Book

2012-04-12 Thread Jani Tiainen
I don't remeber the exact details, but Django book is not part of Django project but separate project. And apparently authors didn't wanted/had time/whatever reason there is upgraded documentation along Django. It would also require lot of upkeeping different versions of books (since every

Re: Django ORM - query help

2012-04-12 Thread Jani Tiainen
hl=en. I suppose that you have to add all fields. I suggest that you install django-command-extensions and IPython. Run ./manage.py shell_plus and start experimenting. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: Django ORM - query help

2012-04-11 Thread Jani Tiainen
the trick: Log.objects.values('thing').annotate(deletion_date=Max('modified_on')).order_by('-deletion_date') -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@google

Re: Django ORM - query help

2012-04-11 Thread Jani Tiainen
Hi, You're not doing anything wrong. The catch is that since "Thing" can exist without Log you will get outer join. If you want to get along with inner join, you should turn query around and start querying from Log model. I'm just too tired to think how it should be done right now... =) On

Re: Model validation fails, when inherited model redeclare parent field

2012-04-03 Thread Jani Tiainen
Hi, You'ew hitting limitation of Django ORM which prohibits overriding fields. https://docs.djangoproject.com/en/1.3/topics/db/models/#field-name-hiding-is-not-permitted 4.4.2012 6:34, shiva kirjoitti: Hello! In our apps (that use Django 1.2.7) we use following models: class

Re: where do you host your django app and how to you deploy it?!

2012-04-02 Thread Jani Tiainen
2.4.2012 13:48, fix3d kirjoitti: Where do you host your django app and how to you deploy it?! Please share personal exp. We're deploying to our own application server cluster. And we're using fabric to run actual deployment. -- Jani Tiainen -- You received this message because you

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Jani Tiainen
Like this: 'default': { 'ENGINE': '...', 'OPTIONS': { 'threaded': True } } 21.3.2012 11:05, Another Django Newbie kirjoitti: On Wednesday, March 21, 2012 7:18:16 AM UTC, Jani Tiainen wrote: 20.3.2012 16:45, Another Django Newbie kirjoitti: > > > O

Re: Basic Random Number Generation

2012-03-21 Thread Jani Tiainen
at 1:01 PM, Jani Tiainen <rede...@gmail.com <mailto:rede...@gmail.com>> wrote: 21.3.2012 9:19, Nikhil Verma kirjoitti: Hi All I want to generate a fix 6-digit random number from a function. eg :- def random_generator(n): #

Re: Basic Random Number Generation

2012-03-21 Thread Jani Tiainen
hoice('0123456789') for i in range(7)] or if you need it: from random import randint # Initializes from current time. def random_int(): return randit(10, 99) Note that pseudorandom generator is only initialized first time import happens. After that you can set it manually using

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-21 Thread Jani Tiainen
20.3.2012 16:45, Another Django Newbie kirjoitti: On Tuesday, March 20, 2012 10:28:49 AM UTC, Another Django Newbie wrote: On Tuesday, March 20, 2012 10:01:36 AM UTC, Tom Evans wrote: On Mon, Mar 19, 2012 at 5:24 PM, Jani Tiainen wrote: >

Re: Problem with Django starting up

2012-03-21 Thread Jani Tiainen
21.3.2012 7:50, Samuel Muiruri kirjoitti: I can't get the first part to work I assume that you have python installed to c:\python27\ You need to add c:\python27\scripts to your path. Or alternatively: c:\python27\scripts\django-admin.py startproject mysite -- Jani Tiainen -- You

Re: Question about threading a view[REPOSTED]

2012-03-20 Thread Jani Tiainen
Hi, Your solution will work perfectly in single process environment (For example with manage.py runserver ) But when you put your app behind webserver you usually invoke several processes. For example if you're using single round-robin loadbalancing over 5 different Django instances. What

Re: Question about threading a view[REPOSTED]

2012-03-20 Thread Jani Tiainen
your AJAX call will definitely be terminated (timed out). So that is not a right solution. Using AJAX to query long running status makes a lot of sense though. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Question about threading a view[REPOSTED]

2012-03-19 Thread Jani Tiainen
e you can still test your long running process but in unit tests you don't test that communication between broker and running system. HTH, Jani Tiainen On Mon, Mar 19, 2012 at 11:17 PM, Arruda <felipe.arruda.pon...@gmail.com>wrote: > Some one also gave me that tip. > I was reading it, b

Re: Problem with tuncated Admin pages in apache + mod_fcgid

2012-03-19 Thread Jani Tiainen
Hi, Since we use same setup except one part: we use mod_wsgi instead of mod_fcgi. (Since wsgi is considered to be defacto protocol). Could you try to use it? On Mon, Mar 19, 2012 at 7:04 PM, Another Django Newbie < another.xxx.u...@gmail.com> wrote: > > > On Thursday, March 15, 2012 1:05:53

Re: Running manage.py commands in Windows Power Shell

2012-03-19 Thread Jani Tiainen
Hi, I (and all my other teammates) are have been developing in windows with standard Python (+ Django + lot of other interesting stuff) in WinXP, Vista, Win7. To keep everyone on same line, we use TCC/LE (Take Command Console/LE) which is augmented CMD. Has lot of nice features. And it's free.

Re: Models, field like a list

2012-03-19 Thread Jani Tiainen
Hi, All depends on a few factors will simple foreign key or many to many be correct solution. If single model B can be assigned only on a single model A then foreign key from B to A is right choice. But if requirement is that model B can be assigned multiple times to model A then it's definitely

Re: Django is very slow on windows server 2003, mssql database

2012-03-13 Thread Jani Tiainen
lists get's populated from foreignkey / m2m tables which might create quite lot of data. I had fun times with my customer foreignkey to address model with 21 million rows in address... :) -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Dj

Re: "Dynamyc" modells

2012-03-13 Thread Jani Tiainen
e RDBMS on top of RDBMS. Also all database CRUD operations would be handcrafted still. I would definitely look using those document oriented databases which would allow doing all that fancy stuff without too much sweat. -- Jani Tiainen -- You received this message because you are subscribed

Re: Problems creating django project in Windows 7

2012-03-08 Thread Jani Tiainen
t use a linux machine as a test server. since it doesn't need a lot of power for that, you can avoid dedicating a real machine by using a virtual one. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Django hgwebdir

2012-03-08 Thread Jani Tiainen
ntended recipient, please notify the sender immediately by return e-mail, delete this communication and destroy all copies. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dja

Re: GeoDjango distance queryset filter with distance value stored within model

2012-03-04 Thread Jani Tiainen
preciated! > > PS: I have posted this also to StackOverflow at > http://stackoverflow.com/q/**9547069/755532?sem=2<http://stackoverflow.com/q/9547069/755532?sem=2> > > Thanks in advance! > > -- > Kind regards > Daniel > > -- > You received this message beca

Re: Django REST

2012-03-04 Thread Jani Tiainen
> To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jani Tiainen -- You received this message because you are subscribed to the

Re: Question mark in Django URL Mapping

2012-01-26 Thread Jani Tiainen
https://docs.djangoproject.com/en/1.3/topics/http/urls/#what-the-urlconf-searches-against -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscri

Re: Disk I/O Error

2011-11-01 Thread Jani Tiainen
to directory where actual database resides. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-user

Re: column user_id is not unique

2011-10-27 Thread Jani Tiainen
ot;id", it shouldn't be using first field defined. -- Jani Tiainen On 26.10.2011 19:03, Shark wrote: There is problem in this project I use Auth User and foreign key in anther table "geoFeeds" and when adding data to table gepFeed am error happened column user_id is not unique when changi

Re: How to make a foreign key field of type other than int?

2011-10-24 Thread Jani Tiainen
s+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-user

Re: When is the django orm going to get a "group by" function ?

2011-09-16 Thread Jani Tiainen
stuck on $databases) ... or a loop... (non-sql). IMHO I should be able to do it via the orm. If you can do it via the orm - how do I do it ? Bar.objects.values('foo').annotate(Count('foo')) As written in Django documentation... -- Jani Tiainen -- You received this message because you

Re: order by + group by

2011-09-14 Thread Jani Tiainen
ed to groups so you won't be able to get "last" that way. It might work non-standard way in some implementations. And thus Django usually follows standard or smallest common nominator for db backends such a thing is not possible to support. -- Jani Tiainen -- You received th

Re: Admin - delete with removing FK objects

2011-09-13 Thread Jani Tiainen
e your own delete hook in admin to traverse through all instances. But be aware that approach you're using has it's caveats: what if deletion stops at some point? You have deleted images from the disk but database _will_ be rolled back thus leaving you with records without images. -- Ja

Re: Django Development environment

2011-08-31 Thread Jani Tiainen
On 08/31/2011 01:46 PM, graeme wrote: On Aug 31, 1:16 pm, Jani Tiainen<rede...@gmail.com> wrote: On 08/28/2011 12:31 PM, Simon Connah wrote: On 28 Aug 2011, at 04:41, Sam Walters wrote: Debug client-side: firebug, yslow, a windows computer with ie7 Rather than using a se

Re: Django Development environment

2011-08-31 Thread Jani Tiainen
ery useful with VirtualBox. [1] http://www.microsoft.com/download/en/details.aspx?id=11575 -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe f

Re: search with a optional value

2011-08-25 Thread Jani Tiainen
had to do that for a good while back and I used following approach: # Add "or contains" query for every nonempty value in form data. q = Q() for k,v in form.cleaned_data.items(): if v: q |= Q(**{k + '__contains' : v}) # Get resultset r = MyModel.objects.filter(q); -- Jani Tiai

Re: Django Development environment

2011-08-22 Thread Jani Tiainen
Ubuntu or windows, eclipse with pydev, apache, nginx, virtualenv and Oracle. Stephen Jackson kirjoitti 23.8.2011 kello 1.07: > I am new to the world of Django. I would like to hear from other django > developers describe their dev environment (tools, os, editors,

Re: Strange behavior in model.save()

2011-08-19 Thread Jani Tiainen
place.save() # Place saved, PK assigned. meeting = Meeting(place=place, when='2011-01-01') meeting.save() # Meeting saved with correct place. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Template html works when double clicked but empty when accessed through server

2011-08-16 Thread Jani Tiainen
/contrib/staticfiles/ -- Jani Tiainen On 08/16/2011 09:23 AM, Adam Zedan wrote: okay going to error ansole of firefox here is what i got Error: Slick is not defined Source File: http://127.0.0.1:8000/db/ Line: 37 which is : grid = new Slick.Grid("#myGrid", data, columns, options); and th

Re: Method call when deleting FK in admin

2011-07-23 Thread Jani Tiainen
Reason is that admin uses QuerySet.delete() (https://docs.djangoproject.com/en/1.3/ref/models/querysets/#delete) Note that deleting files while deleting models is dangerous: what happens if deletion is aborted and rolled back for some reason? You have now deleted files but instances stayed in a

Re: writing function into the Manager or the Model

2011-07-23 Thread Jani Tiainen
/#writing-your-first-django-app-part-2to see how admin is done in recent versions of Django. -- Jani Tiainen On Sat, Jul 23, 2011 at 7:59 PM, Eyad Al-Sibai <eyad.alsi...@gmail.com>wrote: > I am a little bit confused... what functions should I write it in the > Manager and what shou

Re: Database Design Question

2011-07-21 Thread Jani Tiainen
On Thu, Jul 21, 2011 at 10:50 PM, nixlists <nixmli...@gmail.com> wrote: > On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen <rede...@gmail.com> wrote: > > Hi, > > So you want to tie Contract with Product(s) with rebate_pct? You then > need > > custom interme

Re: Database Design Question

2011-07-21 Thread Jani Tiainen
ed ever after saving. hth, -- Jani Tiainen On Thu, Jul 21, 2011 at 8:25 PM, newtodjango <nixmli...@gmail.com> wrote: > Sorry about formatting. Also the there is a mistake. > > "I'd like to define the Product model..." should be > "I'd like to define the Contr

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
ginx and the bar.js request will > be passed to django where you can use a template to dynamically serve it. > > Mick > > > > > > > > On Monday, June 27, 2011 at 8:23 AM, Jani Tiainen wrote: > > Apparently I didn't made myself clear enough. > > > So le

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
Apparently I didn't made myself clear enough. So let me clarify: I have two files that must be accessed using following urls: /myapp/views/foo.js /myapp/views/bar.js foo.js is a static file and can (and should) be served by using static serving, like webserver. bar.js instead is a file that

Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
webserver in production) If load failed: Load dynamic file from templates dir If load failed: Raise error -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: syncdb doesn't create UserProfile table

2011-06-16 Thread Jani Tiainen
ferring it (settings at least) as appname "calltracking_main". Probably fixing appname in model would fix all other issues as well. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: filter chaining question

2011-06-15 Thread Jani Tiainen
on__name='good') | Q(Condition__name='acceptable')) > or IN ('good','acceptable') .filter(Condition__name__in=('good', 'acceptable', )) hth. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Request and null value

2011-06-05 Thread Jani Tiainen
to handle your data, like JSON which can serialize and deserialize data correctly. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this gro

Userprofile, signal and admin inline edit.

2011-05-26 Thread Jani Tiainen
can of course remove signal but that wouldn't create profile if I insert user manually. So how to make things work with both, admin inline profile editing and a signal? -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Stuck at filtering/slicing

2011-05-25 Thread Jani Tiainen
lete=0).order_by('-revisiondate','- > docrevid') > > This gives me all versionnumbers though: I've been trying several ways > to slice, group , do for-loops and can't get it to work.. > Any ideas are greatly appreciated :-) > Thanks > DocumentRevision.objects.values('doc

Re: Basic Django Support

2011-05-16 Thread Jani Tiainen
t; sqlite3.OperationalError: unable to open database file > > > > > Any help would be amazing also any other tutorials anyone could > recommend for starting python web development would be much > appreciated! > Thanks again > -- Jani Tiainen -- You received this m

Re: CharField with choices gets no ... choices

2011-05-12 Thread Jani Tiainen
ich also is documented that something might be wrong if choices are dynamic)) you have to pass callable - which in python means that leave out parenthesis: somefield = models.CharField(choices=somemethod) -- Jani Tiainen -- You received this message because you are subscribed to the Google Group

Re: outer joins, raw sql or one-to-many?

2011-05-10 Thread Jani Tiainen
on') And now it's like walk in the park: for document in Document.objects.all(): for author in document.authors: print author.firstname, author.lastname -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group.

Re: filter in python

2011-05-10 Thread Jani Tiainen
College.objects.filter(branch_q) note that branch_q construction is not necessary, you can do it directly: college_list = College.objects.filter(**branch_kwargs) -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: filter in python

2011-05-09 Thread Jani Tiainen
nks for ur answer jani but i didn't get it . as i am getting one > query for branch {which is Qbranch} so where i use this? > > On May 8, 10:40 pm, Jani Tiainen <rede...@gmail.com> wrote: > > On Sun, 2011-05-08 at 09:59 -0700, pankaj sharma wrote: > > > hello ..

Re: filter in python

2011-05-08 Thread Jani Tiainen
struct: branches_query=Q(branch1=branch1_form_field_value) | Q(branch2=branch2_form_field_value) | ... -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegrou

Re: django searching

2011-05-02 Thread Jani Tiainen
Q-objects for that (they're very powerful beings, you should read about them in the docs.) college_list = College.objects.filter((Q(name__icontains=Q1) | Q(city__icontains=Q2)) Hope that helps. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups

Re: Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
should ultimately be served by a different server, > specifically set up for static content (see the django docs... they > mention this). To implement the static URL, use either the > 'staticfiles' app for django 1.2.x or use the built in static files > for django 1.3. > > HTH >

Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
ally static js parts. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@goog

Re: Determining profile completeness

2011-04-14 Thread Jani Tiainen
en just do simple percentage calculation: (all weights summed / filled fields wegihts summed) * 100 = percentage of completeness... -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: Check all foreign keys before delete.

2011-03-25 Thread Jani Tiainen
age" without it > effecting and other records in the database. And if you're lucky and running 1.3 version you have new option on on_delete actions that can do it autogically. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Dj

Re: how to select tables in inspectdb?

2011-03-25 Thread Jani Tiainen
You just can cherry pick what you need. And specially you don't end up having tons of models (tables) you really don't even need. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send em

Re: High availability deployments

2011-03-25 Thread Jani Tiainen
We're all wrong... :) We're all wrong... Yes... Well first at all regradless of any programing language etc. there must be a service level agreement that states what that magical "high availabilty" really means. Usually, even in very critical systems there is reservation for short downtimes to

Re: High availability deployments

2011-03-24 Thread Jani Tiainen
Hi, First at all, if you're working with real high availability system you already have resolved most of the single point of failure problems, and other non- django related issues (like broken hardware, broken network connections etc.) And by looking what you're experiencing now indicates that

Re: Override Method on DB get / filter / all

2011-02-13 Thread Jani Tiainen
our own custom model field that does decoding/encoding as needed. No more hacking into save/get procedures. See <http://docs.djangoproject.com/en/1.2/howto/custom-model-fields/> for more information. -- Jani Tiainen -- You received this message because you are subscribed to the G

Re: different length queries

2011-02-03 Thread Jani Tiainen
_kwargs) You can pass a sequence: q_list = [ Q(foo_bar__icontains='bar'), Q(bar_baz=123), ] qs = MyModel.objects.filter(q_list) Both creates AND queries. If you need something more complex you can chain Q queries: q_query = Q() # Initialize empty query q_query &= Q(foobar__icontains='foo

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Jani Tiainen
that can tell "active users within last X minutes" quite easily. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from th

Re: working django with existing database

2011-01-31 Thread Jani Tiainen
particular ORM). I'm not sure does it run under Mono or Linux but. But it did very good job to produce output like I wanted with a little effort. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: working django with existing database

2011-01-30 Thread Jani Tiainen
you really need only a few of them and can easily add new ones as you go. Also finding things like m2m relations are not easy to do automatically, though not possible. -- Jani Tiainen On Monday 31 January 2011 07:20:50 arief nur andono wrote: > sorry for undetail, i use oracle >

Re: Django and Oracle XE - Empty models file

2011-01-28 Thread Jani Tiainen
second) We've worked around this by declaring our own custom field. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, se

Re: Error filtering using bboverlaps

2011-01-25 Thread Jani Tiainen
ion GeoManager as their default manager? -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsu

Re: Versioned database content

2011-01-25 Thread Jani Tiainen
You probably want to look at abstract models in Django. It's also known as concrete inheritance in some ORMs -- Jani Tiainen On Tuesday 25 January 2011 09:42:08 akaariai wrote: > Hello all, > > My problem is as follows: I have content (for simplicity, lets say > articles), and

Re: Mysql Quires using raw()

2010-11-11 Thread Jani Tiainen
ion. > where I am wrong? Nowhere. Output is correct and as documented - you get back *RawQuerySet*. Not a single value. So you have to do something like: maxid = Client.objects.raw('SELECT MAX(job_no) as max_job_no FROM CLIENT').values_list('max_job_no', flat=True)[0] -- Jani Tiainen -- Y

Re: Mysql Quires using raw()

2010-11-09 Thread Jani Tiainen
ion. > where I am wrong? Nowhere. Output is correct and as documented - you get back *RawQuerySet*. Not a single value. So you have to do something like: maxid = Client.objects.raw('SELECT MAX(job_no) as max_job_no FROM CLIENT').values_list('max_job_no', flat=True)[0] -- Jani Tiainen -- Y

Re: grouping of fields inside a model into a class

2010-11-07 Thread Jani Tiainen
not that intuitive but looks similiar. Also you need to be very careful about reverse relations. See more at: http://docs.djangoproject.com/en/1.2/topics/db/models/#abstract-base-classes http://docs.djangoproject.com/en/1.2/topics/db/models/#be-careful-with- related-name -- Jani Tiainen -- You rec

Re: SERIALIZING

2010-11-04 Thread Jani Tiainen
in documentation come back and ask. [1] http://www.catb.org/~esr/faqs/smart-questions.html#homework -- Jani Tiainen On Wednesday 03 November 2010 15:15:49 sami nathan wrote: > HOW TO GET XML RESPONSE in following > THIS IS HOW MY URL.PY LOOKS LIKE > > from django.conf.urls.defaults imp

Re: Caching JSON in Django

2010-08-25 Thread Jani Tiainen
Is your AJAX query POST or GET query? Because as you may know, POST queries are not cached, GET queries are. Note that if you're still using large pieces of JSON data, upstream caches are not used (data is always sent from Django) which makes some extra load on Django app. > Thanks for you

Re: Caching JSON in Django

2010-08-25 Thread Jani Tiainen
helpful and don't forget the caching parts. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to djang

Re: What is best practice for pluggable modules in app

2010-08-24 Thread Jani Tiainen
to contribute to ui. Note that appname is only last part of python namespace and it must be unique within one django project. For example you can't have "shipping.modules.ups" and "invoicing.modules.ups" due the limitations of Django itself. -- Jani Tiainen -- You r

Re: jsonrpclib 403 error

2010-08-20 Thread Jani Tiainen
wn solution for that: http://drpinkpony.wordpress.com/2010/01/12/django-json-rpc-service/ It works pretty nicely with Dojotoolkit at least, and it's been battle tested now in production environments. -- Jani Tiainen -- You received this message because you are subscribed to the Google G

Re: High memory consumption when going through all records

2010-08-12 Thread Jani Tiainen
es not free them. I see this with development server, debug on > and mysql as a DB backend. That is your problem. when DEBUG = True Django ORM records every SQL query made in a request - or in case of script whole lifetime of a script which can grow quite huge. http://docs.djangoproject.

Re: Reporting Library??

2010-08-12 Thread Jani Tiainen
ilt on top of ReportLab and has pretty good Django support as well. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this gr

Re: Best way to find near people

2010-07-29 Thread Jani Tiainen
ntrib.gis). Spatialite, Postgis, Mysql or oracle. All supports at spatial to some extent. And there you can do easily simple filtering: Person.objects.filter(person_coordinates__dwithin(me.coordinates, distance)) ...and geodjango + spatial engine behind it will take care of all that complex stuff. Note: you

Re: How To Create POST data without an actual POST?

2010-06-29 Thread Jani Tiainen
d even "real" request from parser. You could do even custom command that accepts "post data" as json and pushes it to database through the form you've created. Even forms normally take in request.POST using them is not limited to plain HTTP POST requests but you can d

Re: How can I test the correctness of my models against the schema of a database?

2010-05-31 Thread Jani Tiainen
gives you other problems. In any case this seems not to > > be the correct way. > > > > Has anyone of you faced this situation before? Any clues? > > > > Thank you in advance. > > > > Best Regards, > > David Horat -- Jani Tiainen

Re: Multi-table inheritance - knowing the child object from the parent

2010-05-18 Thread Jani Tiainen
iminator field to tell what type of child you must also fetch to make data complete. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from

Re: Django Admin - m2m widget with blank=true, null=true - How to unselect all FKs?

2010-04-19 Thread Jani Tiainen
and there is quite little you can do about it. -- Jani Tiainen On 04/19/2010 08:45 AM, Victor Hooi wrote: Jani, Aha, that worked, thanks =). Don't know why I didn't think about using Ctrl...lol. However, do you think it'd be obvious to new users, to use ctrl? Cheers, Victor On Apr 19, 2:46

Re: Django Admin - m2m widget with blank=true, null=true - How to unselect all FKs?

2010-04-18 Thread Jani Tiainen
to unselect it. Clicking out of the widget simply seems to unfocus the widget, but the selected items still seem selected. Click one item, then (at most os/computers/browsers) press CTRL down and click selected entry. It should clear selection. -- Jani Tiainen -- You received this message because

Re: Plugin for Eclipse

2010-04-13 Thread Jani Tiainen
in duplicate implementation. Regards, Zbiggy Don't know does there exist any other alternative but your plugin seemed to do pretty good job. One of the last features I've been missing from Eclipse+PyDev package. -- Jani Tiainen -- You received this message because you are subscribed

Re: Remove items from queryset?

2010-01-22 Thread Jani Tiainen
ng all objects from your queryset. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr..

Re: A question about database models

2010-01-14 Thread Jani Tiainen
dn't guessed yet, you have to still add "related_name" argument for field definition. What it means can be found at django documentation: <http://docs.djangoproject.com/en/1.1/ref/models/fields/#django.db.models.ForeignKey.related_name> -- Jani Tiainen -- You received this message

Re: Table with 4 Milions of rows

2010-01-12 Thread Jani Tiainen
I've only 21 million rows in one of my tables and querying it is not a problem. First check that suggested function based index, it might help and you don't need to do anything. istartswith uses "not so good" format. We have got around it using additional field that is autopopulated, in your case

Re: Namespace Security

2010-01-12 Thread Jani Tiainen
ever was intended to be used for an end user activity management, which leads to utterly complex solutions trying to overcome this problem. It probably could be simpler to create custom admin site for this purpose than trying to get around limitations of standard admin site. -- Jani Tiainen -- Yo

Re: adding custom variables to the Meta class

2010-01-05 Thread Jani Tiainen
ply: > > 5/ document the fact that the 'lat_lng' field name MUST be named > 'lat_lng', period !-) > > > My 2 cents... > Or... :) from django.db import models models.options.DEFAULT_NAMES += ('my_first_val', 'my_second_val') class MyModel(models.Model): class Meta: my_first_

Re: Newbie question: empty is not empty?

2009-12-31 Thread Jani Tiainen
On Thu, 2009-12-31 at 03:20 -0800, BobAalsma wrote: > Thanks Masklin, I've just tried your suggestion and there is no > change. > > I'm somewhat mystified by the 'u' that gets added to all answer > messages - is this something to do with unicode? Could this be the > root of (some) evil? Again,

Re: Newbie question: empty is not empty?

2009-12-31 Thread Jani Tiainen
and thus existing as empty string in GET/POST parameters. None of standard middlewares don't mangle POST/GET parameters. To make something useful out of it, use Django forms to post process form to distinguish between emtpy and non empty values. -- Jani Tiainen -- You received this message becaus

Re: Rails-style form value deserializer?

2009-12-19 Thread Jani Tiainen
Result is stored in request.POST (or you can do same with get params, ?foo=one=two). for example request.POST.getlist('foo'). Default getitem implementation returns only last occurence from list. See: http://docs.djangoproject.com/en/1.1/ref/request-response/#querydict-objectsfor more info.

Re: Django editor for Debian

2009-12-16 Thread Jani Tiainen
on, all depends on your preferences. Personally I'm quite happy with eclipse + pydev. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe fr

Re: ORM using tons of memory and CPU

2009-12-14 Thread Jani Tiainen
Django's is the first ORM I have ever used and these sneaky > performance issues are making me wonder... > If you have DEBUG=True setting Django also records _every_ SQL query made to database and depending on a case, it might use quite lot of memory. -- Jani Tiainen -- You received t

<    2   3   4   5   6   7   8   >