Re: Django development with iPad as target platform?

2011-05-27 Thread Russell Keith-Magee
On Fri, May 27, 2011 at 10:25 PM, Shawn Milochik wrote: > On 05/27/2011 10:21 AM, Thomas Weholt wrote: >> >> I just got my hands on an iPad and was wondering if anybody has done >> any django development where the iPad was the target >> platform/browser/client? >> >> Thanks in advance and expect s

Re: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-27 Thread Naoko Reeves
I see if column is set to AutoField then Django won't send INSERT poll_key as null. Now my problem is that it doesn't return newly assigned primary key value for me if primary key name is _key instead of _id It looks as if sequence name is not understood correctly. Could you tell me if 1) I need to

Re: Why self-defined session_key got changed when save in DB?

2011-05-27 Thread Jimmy
btw, I use Django-1.3. Is this a bug? On May 28, 11:00 am, Jimmy wrote: > Hi, > > I have following code to set self-defined session_key: > > >>> from django.contrib.sessions.backends.db import SessionStore > >>> from django.contrib.sessions.models import Session > >>> a = SessionStore(session_key

Re: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-27 Thread Naoko Reeves
Casey, Thank you for your help! As Casey suggested by changing the column definition of model to: poll_key = models.AutoField(primary_key=True) Now create INSERT statement as follows: INSERT INTO "poll" ("poll_question", "poll_pub_date") VALUES ('Question!', '2011-05-27 00:00:00') With PostgreS

Why self-defined session_key got changed when save in DB?

2011-05-27 Thread Jimmy
Hi, I have following code to set self-defined session_key: >>> from django.contrib.sessions.backends.db import SessionStore >>> from django.contrib.sessions.models import Session >>> a = SessionStore(session_key="fwefwejfo3j20jf02jnfweojfeo") >>> a.save() >>> a.session_key 'a6e020a64789b5644e923c

Re: django-cms and photologue

2011-05-27 Thread Venkatraman S
On Fri, May 27, 2011 at 5:32 PM, Dave Sayer wrote: > > I have a question relating to integrating django-photologue with > django-cms. I have added the cmsplugin-photologue app and am now > attempting to add the relevant tags to my templates. The trouble is, > is that I can't seem to find the corr

Installing Django on Ubuntu

2011-05-27 Thread DogGoesOut
Hey, can anyone help me out? For some reason, django is not as easy as it would appear to install on my ubuntu laptop. Here are the stats: I'm running Ubuntu 10.10 Maverick Meerkat, and have Python 2.6 installed already, So far, I've installed a subversion successfully, and am attempting to create

Re: primary key auto increment with PostgreSQL and non Django standard column name

2011-05-27 Thread Casey Greene
Doesn't autofield with primary_key=True handle this for you (instead of making it an IntegerField): https://docs.djangoproject.com/en/1.3/ref/models/fields/#autofield Hope this helps! Casey On 05/27/2011 07:22 PM, Naoko Reeves wrote: Hi, I have a Django newbie question. My goal is to auto inc

Re: Django development with iPad as target platform?

2011-05-27 Thread javatina
> The only thing I wish sites would do is to STOP redirecting my phones > and tablets to their "mobile version." I hate that. Can you please explain why? I understand that that may be true for iPad, but for the phones? -- You received this message because you are subscribed to the Google Groups

primary key auto increment with PostgreSQL and non Django standard column name

2011-05-27 Thread Naoko Reeves
Hi, I have a Django newbie question. My goal is to auto increment primary key with non Django standard column name. We are converting from existing database and primary key schema is "tablename_key" and not "id". I googled it and end up reaching to this ticket: https://code.djangoproject.com/ticket

Auditing Record Changes in All Admin Tables

2011-05-27 Thread Lee
All of my tables have 4 audit fields: created (timestamp) created_by (user name) updated (timestamp) updated_by (user name) I'd like to define a subclass of models.Model that sets these fields on create/update, and then make all my models of that subclass -- but all the related posts I see imply

Re: Getting "most"

2011-05-27 Thread bax...@gretschpages.com
And that works, with one exception: .get_object_for_this_type(pk=object['object_id']) Getting the objects IS a bit inefficient, but since I only need the top 10, I can live with it. On May 27, 12:32 pm, Jason Culverhouse wrote: > If you were to do something like this: > > from django.models impo

Form and ForeignKey Limiting

2011-05-27 Thread Christoffer Viken
Hi, I am having a bit of a problem with a form. example (mind the psudo code) (Model user: included in Django) Model manager:     user = ForeignKey(user) Model task:     user = ForeignKey(user) manager = ForeignKey(manager) What I want to do somehow. Is with a form, being able to create a n

Display Model.id in fieldsets used in Admin Site

2011-05-27 Thread Frisbie
Hello, Is there any way to display a display a Model's id field using the fieldsets field in the Admin model? For example: class CodeJobAdmin(admin.ModelAdmin): fieldsets = [ #('JobID', {'fields': ['id']}), ('Status', {'fields': ['status', 'owners']}), # more fields...

Re: Django Admin static base.css ignored

2011-05-27 Thread Lee
> How are you telling Django about your overridden CSS? Are you specifying it > in the ModelAdmin class, or in an overridden template? > > I hope you're not expecting it to be picked up automatically, as there's > nothing in the documentation to imply that is the case. > -- > DR. Well, collectstat

Re: Django Admin static base.css ignored

2011-05-27 Thread Daniel Roseman
On Friday, 27 May 2011 20:04:03 UTC+1, Lee wrote: > > I've customized myproject/static_files/admin/css/base.css but my > customizations are ignored. If I make changes to /usr/lib/python2.4/ > site-packages/django/contrib/admin/media/css/base.css it works fine. > I've double-checked the STATIC se

Django Admin static base.css ignored

2011-05-27 Thread Lee
I've customized myproject/static_files/admin/css/base.css but my customizations are ignored. If I make changes to /usr/lib/python2.4/ site-packages/django/contrib/admin/media/css/base.css it works fine. I've double-checked the STATIC settings in settings.py and all looks correct. Any ideas? Thanks

Re: Is there an HTML editor that's Django-aware

2011-05-27 Thread Doug Ballance
Everyone has different requirements, but I'm one of those strange people who don't care about having a powerful editor. I don't want completion, or auto-anything. Just something that gets out of my way and lets me work. If something complex needs to be done on occasion, that's what the shell and

Re: Getting "most"

2011-05-27 Thread Jason Culverhouse
On May 27, 2011, at 9:58 AM, bax...@gretschpages.com wrote: > I have a "watch" model that lets users keep an eye on various things > through a generic relation: > > class Watch(models.Model): >subscriber = models.ForeignKey(User, verbose_name="Subscriber") >content_type = models.ForeignK

Getting "most"

2011-05-27 Thread bax...@gretschpages.com
I have a "watch" model that lets users keep an eye on various things through a generic relation: class Watch(models.Model): subscriber = models.ForeignKey(User, verbose_name="Subscriber") content_type = models.ForeignKey(ContentType) content_object = generic.GenericForeignKey() obj

Re: caching ajax json (post)

2011-05-27 Thread Malcolm Box
On 27 May 2011 08:12, Олег Корсак wrote: > Hello. Is there a way to cache ajax json responce after post request > like after get? > Thanks. > > Where do you want to cache it? Why do you want to cache a POST request? POST should be used to alter the state of the application - so it's probable that

invalid label

2011-05-27 Thread Bobby Roberts
ok got a strange situation here. I'm using Satchmo for a shopping cart and have an independent module i wrote which is called from the main nav. This module works fine on every page of the site except for the product detail page in Satchmo. When i view the page in satchmo i get this error: Dja

Re: Form Validation - Redisplay With Error

2011-05-27 Thread Robin
Thanks, Derek! Wikipedia makes good sense. On May 27, 1:14 am, Derek wrote: > On May 26, 1:07 am, Robin wrote:> I'm very > comfortable with SQL and more traditional programming.  Would > > you recommend some specific HTTP primer, or anything  else for those > > making the transition to web dev

Re: Django Model Designer - UML

2011-05-27 Thread Lee
If you can generate the DDL with your tools, build the new database and point inspectdb at it to generate Django models: https://docs.djangoproject.com/en/dev/howto/legacy-databases/?from=olddocs?from=olddocs On May 27, 8:06 am, Mateusz Harasymczuk wrote: > I am looking for a GUI tool for modeli

@login_required & Redirect...best practice?

2011-05-27 Thread Robin
When I have a view that's @login_required -- and the user isn't logged in -- what's the best way to deal with the URL they wanted in the first place? Assuming they log in properly and I want to then redirect them on to where they intended to go in the first place...what's the best practice? I'm n

Re: sitemaps not quite as easy to setup as suggested?

2011-05-27 Thread i...@webbricks.co.uk
found the following snippet of code, managed to get it doing what i want with it. http://stackoverflow.com/questions/4836188/django-sitemaps-and-normal-views Matt On May 27, 4:45 pm, Addy Yeow wrote: > I keep sitemap for those objects in 1 sitemap file, and manually create > another sitemap fil

Django dynamic form simple Example

2011-05-27 Thread Afshin Moshrefi
I have a simple requirement for creating a dynamic form in Django - I've seen many examples but they seem to be incomplete, or require more extensive knowledge of Python and Django than I have! None show how the dynamic portion of the example should be called: This is the form class with Q1 and Q

Re: sitemaps not quite as easy to setup as suggested?

2011-05-27 Thread Addy Yeow
I keep sitemap for those objects in 1 sitemap file, and manually create another sitemap file for all my static pages. Then, create a sitemap index to point to the two. Would love to hear from others though. On Fri, May 27, 2011 at 11:22 PM, i...@webbricks.co.uk wrote: > ok, read the docs proper

Re: sitemaps not quite as easy to setup as suggested?

2011-05-27 Thread i...@webbricks.co.uk
ok, read the docs properly and understood it a bit more. im stuck with one thing though. i get how simple it is to tell the sitemap about all the objects that have been created but what about the static pages, where you've not used flatpages. for instance a contact form you've created, this should

Django Model Designer - UML

2011-05-27 Thread Mateusz Harasymczuk
I am looking for a GUI tool for modeling Django model classes. I have a pretty large app and I need to refactor it. I used django-extensions and *graph_models* to dump the schema to the GraphViz dot file. And I am stuck here :} I would like to import either GraphViz dot file, or models source fi

Re: Django development with iPad as target platform?

2011-05-27 Thread rafael.nu...@gmail.com
In development now, and using Sencha Touch(ExtJS) http://www.sencha.com/products/touch/. --Rafael On Fri, May 27, 2011 at 11:21 AM, Thomas Weholt wrote: > I just got my hands on an iPad and was wondering if anybody has done > any django development where the iPad was the target > platform/browse

Re: Django development with iPad as target platform?

2011-05-27 Thread Shawn Milochik
On 05/27/2011 10:21 AM, Thomas Weholt wrote: I just got my hands on an iPad and was wondering if anybody has done any django development where the iPad was the target platform/browser/client? Thanks in advance and expect some django-app aimed at ipad in the near future ;-). As someone who had a

Django development with iPad as target platform?

2011-05-27 Thread Thomas Weholt
I just got my hands on an iPad and was wondering if anybody has done any django development where the iPad was the target platform/browser/client? Thanks in advance and expect some django-app aimed at ipad in the near future ;-). -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You

Re: 200 OK message

2011-05-27 Thread Brendan Smith
bump? On Thu, May 26, 2011 at 11:11 AM, Brendan Smith < bren...@nationalpriorities.org> wrote: > hey all, > > I pushed some changes to my code last night and this morning upon trying to > add an object (based on a model I added last night) this morning I am > getting the following response: > > O

Re: nested template tags

2011-05-27 Thread bruno desthuilliers
On May 26, 9:21 am, Andreas Rammhold wrote: > Heya, > I'm not 100% sure if this solves the problem I'm 101% sure it doesn't. > for you (or if it's even > intended to do what you want) but: > > {% with old_i=i %} >     {{ i > }} > {% endwith %} Except for the useless aliasing of 'i', how is thi

django-cms and photologue

2011-05-27 Thread Dave Sayer
Hi All, I have a question relating to integrating django-photologue with django-cms. I have added the cmsplugin-photologue app and am now attempting to add the relevant tags to my templates. The trouble is, is that I can't seem to find the correct tags for getting the relevant data from photologue

Django admin and jQuery select filtering

2011-05-27 Thread Ryan
Hi, First of all I will start by saying that I am fairly new to django, jQuery and javascript, but have been using python for a number of years now. In order to get to know django, I thought I would try to develop a ladder application to display player rankings for my local squash club. As pa

Re: Looking for Class Base Views intro (not Generic Class Base Views!)

2011-05-27 Thread Brian Bouterse
One reason its hard to pull the concept of Class Based views and Generic views apart is because they actually go together. Consider the following: 1. Class based views typically use the as_view()class method as its en

Re: nested template tags

2011-05-27 Thread ozgur yilmaz
thanks for your help... template tag: @register.filter(name='get_page') def get_page(var, name): return u"%s=%d" % (name,var) template: {% with i|get_page:'page' as xxx %} i {% endwith %} yes, i was planning to use snippet at http://djangosnippets.org/snippets/553/ for get parame

Re: Overridden Admin Template Not Recognized

2011-05-27 Thread Brian Bouterse
You'll need make sure that "django.template.loaders.filesystem.Loader" is enabled in your TEMPLATE LOADERS to use the app in the way you want. Also, you'll need to place your app BEFORE the 'django.contrib.admin' application in the INSTALLED_APPS list. Hope this helps, Brian On Thu, May 26, 2011

sitemaps not quite as easy to setup as suggested?

2011-05-27 Thread i...@webbricks.co.uk
hi all, struggling to get sitemaps setup. followed docs, including working out there was an import missing in the docco. this is the copy n paste error Environment: Request Method: GET Request URL: http://coatesconstruction.co.uk/sitemap.xml Django Version: 1.3 Python Version: 2.5.2 Installed

Re: where is 'request' as in from x import y

2011-05-27 Thread bruno desthuilliers
On May 27, 10:58 am, MikeKJ wrote: > Interesting, I thought I was doing that in my save method but obviously I > cant be. Of course it can't. The request only exists when there's an actual HTTP request sent to your HTTP server. Your model code is (hopefully) totally independant and unaware of the

custom save method - inlineformset_factory

2011-05-27 Thread rayfidelity
Hi, This is my models.py class Invoices(models.Model): ... sum_w_vat = models.DecimalField(max_digits=7, decimal_places=2, default=0) sum_wo_vat = models.DecimalField(max_digits=7, decimal_places=2, default=0) sum_discount = models.DecimalField(max_digits=7, decimal_places=2, defa

custom User class

2011-05-27 Thread venky
In one of my applications while defining models I have made django provided "User" class as super class for my custom user class (myuser) as shown below. In the database, I see that there is a pointer record pointing to User table (in my custom "myuser" table). The problem here, when I reset my app

Re: OperationalError: no connection to the server using Django and gunicorn

2011-05-27 Thread Adrián Ribao
I'm doing it manually because I'm just testing: ./manage.py run_gunicorn -c gunicorn.conf.py where gunicorn.conf.py # -*- coding: utf-8 -*- import multiprocessing bind = "127.0.0.1:8000" workers = multiprocessing.cpu_count() * 2 + 1 worker_class = 'gevent' On 27 mayo, 02:23, Shawn Milochik w

Re: Is there an HTML editor that's Django-aware

2011-05-27 Thread Tom Evans
On Thu, May 26, 2011 at 9:05 PM, AJ wrote: > I'd like to know why people really like Vim if it is "a piece of shit" ? > Just want to know because I try to learn it everytime and I hear great > things about it. > > We're all coprophiliacs. But seriously.. One of the Pragmatic Programmer tips (buy

Re: where is 'request' as in from x import y

2011-05-27 Thread MikeKJ
Interesting, I thought I was doing that in my save method but obviously I cant be. example. Model 1: auth_user_id row_id_of model_being_saved timestamp Model 2: something def save(self): auth_user_id = request.user.id row_id_of_model_being_saved = something Model

Re: admin ordering for NULL fields

2011-05-27 Thread Kirill Spitsin
On Fri, May 27, 2011 at 12:35:26AM -0700, Dennis Schmidt wrote: > In the admin panel I set a (descending) ordering on a model's date > field. That's fine of course. Now, the "problem" is, that this field > may be NULL in some cases and I want these items to appear at the > beginning of the list. Th

admin ordering for NULL fields

2011-05-27 Thread Dennis Schmidt
In the admin panel I set a (descending) ordering on a model's date field. That's fine of course. Now, the "problem" is, that this field may be NULL in some cases and I want these items to appear at the beginning of the list. They appear at the very end. If I set the ordering to ASCENDING, then they

Re: Form Validation - Redisplay With Error

2011-05-27 Thread Derek
On May 26, 1:07 am, Robin wrote: > I'm very comfortable with SQL and more traditional programming.  Would > you recommend some specific HTTP primer, or anything  else for those > making the transition to web dev? > Assuming good faith in the wisdom of the crowd... : http://en.wikipedia.org/wiki/Ht

caching ajax json (post)

2011-05-27 Thread Олег Корсак
Hello. Is there a way to cache ajax json responce after post request like after get? Thanks. signature.asc Description: OpenPGP digital signature

Re: json serialization question

2011-05-27 Thread Ian Clelland
On Tue, May 24, 2011 at 8:36 AM, Sells, Fred wrote: > My code looks like this > > records = models.Residents.objects.extra( where=[], params=[...]) > data = serializers.serialize('json', records, ensure_ascii=False, > fields=('fname','lname', 'pt')) > return HttpResponse(data) > > After experi