Re: How to get oracle NUMBER with syncdb

2012-10-17 Thread Jani Tiainen
and I had full control over how to map database to Django ORM. Though ordering problem still was persstent but at least I got models more or less right from the very beginning. [1] http://sourceforge.net/projects/mygeneration/ -- Jani Tiainen - Well planned is half done and a half do

Re: How to get oracle NUMBER with syncdb

2012-10-17 Thread Jani Tiainen
reate your own custom field and use just a NUMBER datatype. See https://docs.djangoproject.com/en/1.4/howto/custom-model-fields/ for more information. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscri

Re: Django Troubleshooting

2012-10-22 Thread Jani Tiainen
ualenv I wrote short tutorial as well: http://djangonautlostinspace.wordpress.com/2012/04/16/django-and-windows/ -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django user

Re: Strange behavior in model.save()

2011-08-19 Thread Jani Tiainen
correct order. place = Place(where='Paris') 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 Group

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, etc.). > -- > You received thi

Re: search with a optional value

2011-08-25 Thread Jani Tiainen
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); --

Re: Django Development environment

2011-08-31 Thread Jani Tiainen
eful 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: 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 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 separate computer with IE 7 I

Re: Admin - delete with removing FK objects

2011-09-13 Thread Jani Tiainen
write 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 i

Re: order by + group by

2011-09-14 Thread Jani Tiainen
applied 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 recei

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 mes

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

2011-10-24 Thread Jani Tiainen
p, send email to django-users@googlegroups.com. 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 subscrib

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 w

Re: Disk I/O Error

2011-11-01 Thread Jani Tiainen
ires read and write rights 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 gro

Re: Question mark in Django URL Mapping

2012-01-26 Thread Jani Tiainen
t after question mark) are not parsed by url parser but passed in request GET dictionary. More information in 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

Re: Unique Id issue

2012-12-12 Thread Jani Tiainen
the database(s). -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- 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

Re: Serving static files: Tried 3 ways with no luck

2012-12-27 Thread Jani Tiainen
meant for user uploaded content. STATIC_URL then gives root URL where static files are served. In testing /static/ is good one, in production you might want to do some optimizations there. Now you should be able to get it working. -- Jani Tiainen - Well planned is half done and a half don

Re: Using django's oodb alone

2013-01-03 Thread Jani Tiainen
se it like any other Python library, just provide configuration and you're good to go. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django users" group. T

ORM, Oracle and UTF-8 encoding problem.

2013-01-08 Thread Jani Tiainen
. Additional note: If I use cursor() from Django connection object strings get broken also. So it must be django Oracle backend doing something evil for me. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are s

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-08 Thread Jani Tiainen
I'll try to figure out what causes that problem. On 8 tammi, 17:34, Jani Tiainen wrote: Hi, I've been trying to save UTF-8 characters to oracle database without success. I've verified that database is indeed UTF-8 capable. I can insert UTF-8 characters directly using cx_Or

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-08 Thread Jani Tiainen
_bytes. If I remove that and use convert_unicode as force_text / force_unicode everything works as expected. 9.1.2013 8:56, Jani Tiainen kirjoitti: 8.1.2013 21:00, akaariai kirjoitti: I created the following test case into django's test suite modeltests/ basic/tests.py: def test_un

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-09 Thread Jani Tiainen
cle and unicode capability. I had cx_Oracle.UNICODE defined always which is checked in the code. I don't really know why. 9.1.2013 8:56, Jani Tiainen kirjoitti: 8.1.2013 21:00, akaariai kirjoitti: I created the following test case into django's test suite modeltests/ basic/tests.py:

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-09 Thread Jani Tiainen
9.1.2013 12:28, Ian kirjoitti: On Wednesday, January 9, 2013 12:38:28 AM UTC-7, Jani Tiainen wrote: Tested against latest master. Same behaviour. In Oracle backend base.py is following piece of code: # Check whether cx_Oracle was compiled with the WITH_UNICODE option. This

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-09 Thread Jani Tiainen
9.1.2013 19:21, Ian Kelly kirjoitti: On Wed, Jan 9, 2013 at 3:55 AM, Jani Tiainen wrote: Server is running Oracle Database 10g Release 10.2.0.5.0 - 64bit Production. (EE edition) and charset info: NLS_CHARACTERSETWE8ISO8859P1 NLS_NCHAR_CHARACTERSET AL16UTF16 Sorry, I meant your web

Re: ORM, Oracle and UTF-8 encoding problem.

2013-01-10 Thread Jani Tiainen
10.1.2013 8:59, Ian Kelly kirjoitti: On Wed, Jan 9, 2013 at 11:40 PM, Jani Tiainen wrote: If we just force using force_unicode everything works except in older versions of cx_Oracle (our server had 5.0.4 or something) connection strings can't be unicode for some reason. Sure, that'

Global filtering of the querystes

2013-01-21 Thread Jani Tiainen
way to doit? I only could come up with threadlocals and special manager that can be fed with global filtering rules. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Djan

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Jani Tiainen
aw.php?i=UHE9edVC <http://pastebin.com/raw.php?i=UHE9edVC> (this is from running on my local server rather than production but performance is broadly similar). Can anyone help me? I realise I've perhaps gone off-piste by writing raw SQL but I feel it was justified. t

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Jani Tiainen
realised I missed your final question. For the SQL posted above, the numbers are approximately: 12,000 rows in the `news` table, maybe 10 `news_category` rows, about 100 `writers` and around 3000 `images`. All properly indexed and with sensible column types. On Tuesday, January 22, 2013 10:53:40 AM UTC

Object level permissions implementation

2013-02-04 Thread Jani Tiainen
ve access to Entrance door only but not to carage nor private doors (apartments). So far I've figured out following ways to do what I'm looking for: 1) I could implement all rules to authentication backend. 2) Delegate actual permission checking to models. 3) Something else and bet

Re: Object level permissions implementation

2013-02-04 Thread Jani Tiainen
Molnar kirjoitti: Have you had a look at this 3rd-party package? http://pypi.python.org/pypi/django-object-permissions _Nik On 2/4/2013 4:59 AM, Jani Tiainen wrote: Hi all, I've in need of implementing (rather complex) object level permissions. I've difficulties to determine how

Re: Object level permissions implementation

2013-02-05 Thread Jani Tiainen
e that can tell does user have permission or not to access this object. 5.2.2013 21:00, Nikolas Stevenson-Molnar kirjoitti: If I understand correctly, that's exactly what it's for: https://code.osuosl.org/projects/object-permissions/wiki/Using#Checking-Perms _Nik On 2/4/2013 10:17 PM, J

Re: Object level permissions implementation

2013-02-05 Thread Jani Tiainen
Actually I had slightly incorrect term: I need _field_ (column) level permissions, not object (row) level permissions. 6.2.2013 8:36, Jani Tiainen kirjoitti: No it's not, it's more like enhancement to standard Django permissions that works with predefined "named" permiss

Re: plz help me for error in python for django.....

2013-02-06 Thread Jani Tiainen
t; 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 group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, vi

Re: plz help me for error in python for django.....

2013-02-06 Thread Jani Tiainen
ckages\django\db\backends\sqlite3\base.py", line 344, in execute return Database.Cursor.execute(self, query, params) DatabaseError: no such column: polls_poll.pub_date >>> On Wed, Feb 6, 2013 at 2:49 PM, Jani Tiainen mailto:rede...@gmail.com>> wrote: Now look your

Re: Object level permissions implementation

2013-02-06 Thread Jani Tiainen
.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Gr

Re: Problems doing ajax post with ImageField

2013-02-10 Thread Jani Tiainen
his group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups

Re: One ->Many forms outside admin

2013-02-11 Thread Jani Tiainen
it this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups &quo

Re: One ->Many forms outside admin

2013-02-11 Thread Jani Tiainen
isit https://groups.google.com/groups/opt_out. Inline formsets to be exact is something that you're looking for: https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#inline-formsets -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- Yo

Re: Object composition in django

2013-02-13 Thread Jani Tiainen
//groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: how to password will come in hidden form in django?

2013-02-14 Thread Jani Tiainen
rom it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen -

Python trademark at risk in Europe: We need your help!

2013-02-15 Thread Jani Tiainen
your help. There is a company in the UK that is trying to trademark the use of the term "Python" for all software, services, servers... pretty much anything having to do with a computer." -- Jani Tiainen - Well planned is half done and a half done has been sufficient before

Re: session is not expiring

2013-02-21 Thread Jani Tiainen
..@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Jani Tiainen - Well planned is half done and a half done has been

Re: Best ways and common practices to lock the Database before a new deploy

2013-02-21 Thread Jani Tiainen
page to state that "maintenance in progress" or some other meanful information. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django users" group. To uns

Re: Restful User Authentication for Ember/Backbone client with Tastypie

2013-03-12 Thread Jani Tiainen
TP(S) protocol again and DELETE to /sessions// to logout Personally, if working with Django and HTTP I would go for cookie based auth since it would be natural. Otherwise API key isn't that bad option. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before...

Re: Packaging django, python and a project for one click setup on a windows machine

2013-04-05 Thread Jani Tiainen
ngs.wordpress.com/2008/06/26/django-desktop-app/> [1] http://cx-freeze.sourceforge.net/ [2] http://www.py2exe.org/ -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups "Django us

Re: Oracle database TextField limitations and Django admin interface queries

2013-04-10 Thread Jani Tiainen
#x27;t directly tell what is wrong. It's related types of bind variables and any of them might be incorrect for some reason. -- Jani Tiainen - Well planned is half done and a half done has been sufficient before... -- You received this message because you are subscribed to the Google Groups

Re: Django & Oracle connection problem

2013-05-16 Thread Jani Tiainen
If you want just to connect Oracle but not run server locally using instant client is much more easier option to setup. On Wed, 15 May 2013 02:43:36 -0700 (PDT) Michael Van wrote: > I have the same error when python managment runserver : > cx_Oracle.DatabaseError: ORA-28547: connection to serv

Re: Raise field error in models clean method

2013-05-20 Thread Jani Tiainen
On Sun, 19 May 2013 06:38:50 -0700 (PDT) Kai Schlamp wrote: > Hello. > > How to raise a `ValidationException` in the models `clean` method? > > def clean(self): > from django.core.exceptions import ValidationError > raise ValidationError({'title': 'not ok'}) > > The above d

Testing with complex database setups

2013-05-23 Thread Jani Tiainen
rely heavily that there really exists all that trigger-function mess in the database? So that I don't need everytime to start from the scratch but from some known state of the db? -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django u

Re: Testing with complex database setups

2013-05-26 Thread Jani Tiainen
Bummer... I whish I could have gotten away with Django test framework but it seems that custom testrunner would be the way. Have to check my options really. On Fri, 24 May 2013 03:23:44 -0700 (PDT) akaariai wrote: > On 23 touko, 15:09, Jani Tiainen wrote: > > Hi, > > > &

Re: Dump LineString GEOM to Point GEOM (One Model To Another)

2013-05-31 Thread Jani Tiainen
How can I do this within GeoDjango w/o using rawSQL and bypassing the > models? Linestrings do have coord_seq property that you can iterate over and generate point geometries form that and save to another table. -- Jani Tiainen -- You received this message because you are subscribed to the Goo

Re: Django foreing keys joins

2013-06-06 Thread Jani Tiainen
sting: >>> print Counter.on_medicos.filter(loc_id__isnull=True).only('id').query That should return what you might have been expecting. -- Jani Tiainen "Impossible just takes a little longer" On Thu, 6 Jun 2013 01:05:32 +0200 Àlex Pérez wrote: > Can som

Re: database -> model -> charting

2013-06-07 Thread Jani Tiainen
pretty much any JS charting libraries. Google Charts for example. And pretty much any JS framework you pick do seem to have some kind of a charting library available. Simplest way in most cases is to render data for char as a JSON (which in turn can be uses as-is in for JS) -- Jani Tiainen "

Re: Django tutorial part 1 (Using the api, p.choice_set.all() displays choices in reverse order)

2013-06-18 Thread Jani Tiainen
any good field to sort by in Choice-model. [1] https://docs.djangoproject.com/en/1.5/ref/models/querysets/#order-by -- Jani Tiainen "Impossible just takes a little longer" -- You received this message because you are subscribed to the Google Groups "Django users" group. To un

Re: how to change the root url of a project?

2013-06-26 Thread Jani Tiainen
e is a little you can do. In real case you'll have some server to keep django up and running and there you have option to use suburls as you want to. But it requires setting up real frontend server like nginx, apache or similiar. -- Jani Tiainen "Impossible just takes a little long

Re: How i can get real value of ForeingKey?

2013-06-26 Thread Jani Tiainen
n your model (field1) your model actually contains already two fields: id and field1. In your case field1 can contain any 10 character string. How you want to represent your related object is totally a different story and there is not single correct answer - it all depends how you want to re

Re: Django not enforcing blank=False on a model

2013-07-29 Thread Jani Tiainen
m validation will allow entry of an empty value. If a field has blank=False, the field will be required." Also, you should note that .save() doesn't imply running validation <https://docs.djangoproject.com/en/1.5/ref/models/instances/#validating-objects> -- Jani Tiainen --

Re: User Permissions

2013-07-30 Thread Jani Tiainen
> > -- > > Cadu Leite > twitter: @cadu_leite > http://people.python.org.br/ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receivin

Testing with legacy data

2013-08-05 Thread Jani Tiainen
ldn't like to recreate database from the scratch everytime or not to import data every time. Any suggestions how I could proceed? -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Re: ImportError: No module named 'exceptions' - Python3

2013-08-11 Thread Jani Tiainen
Hi, In Python 3 exceptions module was removed and all standard exceptions were moved to builtin module. Thus meaning that there is no more need to do explicit import of any standard exceptions. On Mon, 12 Aug 2013 10:51:32 +0530 abhijeet shete wrote: > Hi Folks, > > I ported my project

Re: Representing infinity or "no limit" in an integer field?

2013-08-19 Thread Jani Tiainen
ch would suit well in that sense. Problem is that usually databases aren't very fast to search NULL values so if you have to for example produce often list of products that you can buy "infinite amount", you would like to consider using value(s) that don't conflict from valid

Re: Representing infinity or "no limit" in an integer field?

2013-08-20 Thread Jani Tiainen
exed or not. For the rest I don't have knowledge about. That doesn't remove the fact that there will be a limit for ordering one time - though I would be happy to know what "unlimited" amount of ordering would mean and how to actually it would be implemented and what's the

Re: Django signals to all connections?

2013-08-20 Thread Jani Tiainen
Hi, Well it seems that you have understood things a bit incorrectly. First at all, only logged in user is the one accessing some page (a view) from Django system. After that there is nobody logged in traditional sense - there is no simple way to detect that user closed browser and was "logged

Re: serve static files

2013-08-26 Thread Jani Tiainen
fix? > > Thanks. > Wesley > > -- > 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

Load base test data outside Django framework

2013-09-02 Thread Jani Tiainen
plicable to all supported django backends, though Oracle and PostgreSQL (+ PostGIS) is my main target. Sqlite (+ SpatiaLite) would be a bonus. -- Jani Tiainen -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this

Re: Complex query

2013-09-08 Thread Jani Tiainen
Problem is that you have to be able to express it in SQL. And thus ther is not much you can do in SQL to get what you actually wanted. Considering amount of the data fetched - it's relatively low query count and unless you're hitting very busy site you wont notice much of difference doing this

Re: Determining profile completeness

2011-04-14 Thread Jani Tiainen
that. Then 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 ema

Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
ent apps, specially 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+u

Re: Javascript frameworks with Django

2011-04-27 Thread Jani Tiainen
d the django templates unless you're > formatting data a certain way. > > Your static code (you mean static media like javascript, css, and > images, right?) should ultimately be served by a different server, > specifically set up for static content (see the django docs... they &

Re: django searching

2011-05-02 Thread Jani Tiainen
o use 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 Goog

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: filter in python

2011-05-09 Thread Jani Tiainen
; thanks 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 wrote: > > On Sun, 2011-05-08 at 09:59 -0700, pankaj sharma wrote: > > > hello .. > > > >

Re: filter in python

2011-05-09 Thread Jani Tiainen
ge_list = 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

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

2011-05-10 Thread Jani Tiainen
ors. So in Document model you do something like: authors = model.ManyToMany(Author, through='DocumentRevision') 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 --

Re: CharField with choices gets no ... choices

2011-05-12 Thread Jani Tiainen
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: Basic Django Support

2011-05-16 Thread Jani Tiainen
ct(**kwargs) > 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

Re: Stuck at filtering/slicing

2011-05-25 Thread Jani Tiainen
t; versionnumber for each group of documentid. > > I got this far: > found_entries = > Documentrevision.objects.filter(obsolete=0).order_by('-revisiondate','- > docrevid') > > This gives me all versionnumbers though: I've been trying several w

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"

Re: Request and null value

2011-06-05 Thread Jani Tiainen
some known notation 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

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

Re: syncdb doesn't create UserProfile table

2011-06-16 Thread Jani Tiainen
e that you have specified app name for UserProfile as "calltracking" but referring 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 su

Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
bserver 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-users@

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 co

Re: Serving static/dynamic files under same suburl

2011-06-27 Thread Jani Tiainen
ll > 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 let me clarify: > > &

Re: Database Design Question

2011-07-21 Thread Jani Tiainen
should not be changed ever after saving. hth, -- Jani Tiainen On Thu, Jul 21, 2011 at 8:25 PM, newtodjango 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 Co

Re: Database Design Question

2011-07-21 Thread Jani Tiainen
On Thu, Jul 21, 2011 at 10:50 PM, nixlists wrote: > On Thu, Jul 21, 2011 at 2:17 PM, Jani Tiainen wrote: > > Hi, > > So you want to tie Contract with Product(s) with rebate_pct? You then > need > > custom intermediary m2m table say "ContractProduct" > >

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 wrote: > I am a little bit confused... what functions should I write it in the > Manager and what should be within the Model itself... Als

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 da

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

2011-08-15 Thread Jani Tiainen
.com/en/1.3/ref/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, op

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),

Re: Error filtering using bboverlaps

2011-01-25 Thread Jani Tiainen
el have explicit definition 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 em

Re: Django and Oracle XE - Empty models file

2011-01-28 Thread Jani Tiainen
fractions of a 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

Re: working django with existing database

2011-01-30 Thread Jani Tiainen
dels in a short time. So 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 unde

Re: working django with existing database

2011-01-31 Thread Jani Tiainen
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, send email

Re: mis-named setting? SESSION_EXPIRE_AT_BROWSER_CLOSE

2011-01-31 Thread Jani Tiainen
ut. Now you can have feature 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@googlegrou

Re: different length queries

2011-02-03 Thread Jani Tiainen
ry_kwargs = { 'something__startswith' : 'foobar', 'somethingelse__gte': 123 } qs = MyModel.objects.filter(**query_kwargs) You can pass a sequence: q_list = [ Q(foo_bar__icontains='bar'), Q(bar_baz=123), ] qs = MyModel.objects.filter(q_list) Both c

Re: Override Method on DB get / filter / all

2011-02-13 Thread Jani Tiainen
coded_data = decoded.data.decode('string-escape') Why not make your 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 Tia

Re: High availability deployments

2011-03-23 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 y

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: 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 grou

<    1   2   3   4   5   6   7   8   >