Re: Serving Static Files - Pics work, but CSS doesn't

2009-04-16 Thread Tom Evans
On Thu, 2009-04-16 at 11:06 +1200, Wayne Koorts wrote: > Also just another tip: it is a good idea to not use named colour > values ("green" / "red" etc.) as each CSS rendering engine might > interpret it differently. For green you could use: "color: rgb(0, > 255, 0);" and for red you could use:

Re: Problem with self referencing Foreign key field and mysql InnoDB

2009-04-16 Thread Tom Evans
On Thu, 2009-04-16 at 00:33 -0700, limas wrote: > I were using Mysql MyISAM. But I want to enable transaction. > So i shifted to InnoDB. > Actually I have one model as below (*designed somebody i can't > change). > > class Folder(models.Model): >

Re: nested loop issue

2009-04-20 Thread Tom Evans
On Sun, 2009-04-19 at 16:40 -0700, Johan wrote: > Hello > I have a problem I cant get my head around. > I want to list through a bunch of people and see which one im friends > with and which ones i can add as a friend. sort of twitter style. > If it throw in an else it will hit on every step of

Re: Problem with in long text fields in templates

2009-04-20 Thread Tom Evans
On Mon, 2009-04-20 at 09:47 -0700, NoviceSortOf wrote: > By digging around here in this group I found > an answer in using > > {{ book.description|safe }} > It's just a minor thing, since you said this content comes from data entry, but this allows all HTML in book.description to be

Re: Webpy vs Django

2009-04-20 Thread Tom Evans
On Mon, 2009-04-20 at 11:39 -0700, Vishwajeet wrote: > Hi All, > > This is not to flame any war; I just wanted to know the key features > to consider among the two web frame works. > > What advantage and disadvantages you have when you decide using any > one of them. > > Thanks for your help >

Re: Webpy vs Django

2009-04-21 Thread Tom Evans
On Tue, 2009-04-21 at 02:14 -0700, Vishwajeet wrote: > Nothing like that I have done my home work and gone through what you > are suggesting. > I want to understand any practical implications or limitations of the > two. > > >>>The two applications mentioned are wildly,different and for

Re: Flatpages and additional context

2009-04-21 Thread Tom Evans
On Tue, 2009-04-21 at 06:02 -0700, Simon wrote: > I'm using Django flatpages for all the "one-off" pages on my website, > but I'd like to create a "lite" version of the site for iPhone users > (for example) which would use a different style sheet and shorten the > site menu (by missing off

Re: Turning password reset

2009-04-21 Thread Tom Evans
On Tue, 2009-04-21 at 17:12 +0200, Filip Gruszczyński wrote: > > Quick? yes. Elegant? The jury is still out. [1]Ticket8363 includes a patch > > that allow you to exclude selected tests from the suite when you ejecute > > the Django test runner runtests.py. If you can the isolate tests you want to

Re: customization of the form

2009-04-22 Thread Tom Evans
On Tue, 2009-04-21 at 21:20 +0400, Konstantin S wrote: > Hello! > > In my model I have dynamically generated checkbox fields that look like this: > > boxes = forms.ModelMultipleChoiceField(queryset=Box.objects.all(), > widget=forms.CheckboxSelectMultiple) > > The problem is that in the

Re: customization of the form

2009-04-22 Thread Tom Evans
On Wed, 2009-04-22 at 04:42 -0700, Konstantin S wrote: > On Apr 22, 1:51 pm, Tom Evans <tevans...@googlemail.com> wrote: > > On Tue, 2009-04-21 at 21:20 +0400, Konstantin S wrote: > > > Hello! > > > > > In my model I have dynamically g

Re: Saving inline objects

2009-05-01 Thread Tom Evans
On Fri, 2009-05-01 at 05:11 -0700, Alfonso wrote: > I've got a very simple Order model and an invoice model. Currently > within the admin section, the invoice admin page contains associated > orders as an edit_inline. The user adds orders to the invoice by > clicking 'save and continue

Re: Internationalization (i18n) of model: request.LANGUAGE_CODE in __unicode__ and ordering?

2009-05-07 Thread Tom Evans
On Thu, 2009-05-07 at 07:55 -0700, Wouter van der Graaf wrote: > Hi there, > > Spent hours trying to find the solution, but no luck. So here goes... > > Please consider simplified code below: > > {{{ > class Country(models.Model): > ... > label_en = models.CharField(max_length = 128,

Re: Parsing the arguments in HTTP GET

2009-05-15 Thread Tom Evans
On Fri, 2009-05-15 at 14:56 -0700, MohanParthasarathy wrote: > Hi, > > I am very new to django. I am following along the tutorial. But I want > to be able to parse the URL which has the following form: > > http://example.com/data/?ui=2=1#label=/fetch > > From what I can tell, i can't match

Re: login decorator losing POST data

2009-05-15 Thread Tom Evans
On Fri, 2009-05-15 at 16:10 -0500, Tim Chase wrote: > James Bennett wrote: > > On Fri, May 15, 2009 at 1:55 PM, Tim Chase > > wrote: > >> One more option that occurs to me is that you can stash all of > >> the POSTed variables into a session-store with a hash key,

Re: Need help for nested list in template

2009-05-19 Thread Tom Evans
On Tue, 2009-05-19 at 06:46 -0700, laspal wrote: > Hi, > My model is : >id val msg >20 1234 text >20 1245text >20 1275

Re: how can I reset the form object variable (errors)?

2009-05-21 Thread Tom Evans
On Wed, 2009-05-20 at 11:06 -0700, Lokesh wrote: > Hi Karen, > > In one of my HTML page I have included 2 forms, where both the forms > have required=True fields and have submit buttons respectively. > The problem is when a user submits one form (by clicking one of submit > button form the page)

Re: How to write subdomain from django apps

2009-05-21 Thread Tom Evans
On Thu, 2009-05-21 at 16:24 +1000, Joshua Partogi wrote: > Sorry for this lame question. > > I just saw an application called suggestionbox.com and it's able to > write subdomain based on the customer id. Do we access and write BIND > configuration on the fly for this? Or is there a better way

Re: How to include parent name in list of children?

2009-05-27 Thread Tom Evans
On Wed, 2009-05-27 at 06:27 -0700, adelaide_mike wrote: > Very beginner here. > > My model has two classes, Suburb, the parent, and Street, the child: > > class Suburb(models.Model): > suburb_name = models.CharField(max_length=72) > postcode =

Re: Sending POST data and Redirecting to external website from a view

2009-05-29 Thread Tom Evans
On Fri, 2009-05-29 at 09:52 -0700, M Godshall wrote: > Based on everything that I've read on the subject the last few days, > it sounds like it's impossible to redirect a user to an external url > with POST data. If that's the case, I really need some help figuring > out a secure solution to the

Re: Guarding against injection while using AJAX.

2009-05-29 Thread Tom Evans
On Fri, 2009-05-29 at 11:38 -0700, Roberto Cea wrote: > I am accepting user input using the Jeditable library for jQuery, > which sends the data as POST parameters "id" and "value". I am reading > these parameters into a django.forms.Form to sanitize it, like so: > > class

Re: Composite keys or sqlalchemy

2009-05-29 Thread Tom Evans
On Fri, 2009-05-29 at 14:49 -0500, Alex Gaynor wrote: > > > On Fri, May 29, 2009 at 2:45 PM, Mike Driscoll > wrote: > > Hi, > > I asked a similar question about this last year and was told > that > Django would eventually

Re: Using alternating url patterns

2009-06-03 Thread Tom Evans
On Wed, 2009-06-03 at 02:56 -0700, janedenone wrote: > Hi, > > is it possible to use alternating url patterns without confusing the > reverse lookup mechanism? > > I'd like to do something like > > (r'^(authors|autoren)/(?P[_a-z]+)$', 'author_detail'), > > Kind regards, > Jan Define two

Re: Using the django orm outside a web system

2009-06-03 Thread Tom Evans
On Thu, 2009-06-04 at 10:44 +1930, Juan Hernandez wrote: > Hey there people: > > I started developing a django application where a user takes a big > text file and loads it into a database. I have been able to do pretty > much everything but I've been having some problems on scheduling tasks >

Re: Modifying the way a ChoiceField is rendered

2009-06-04 Thread Tom Evans
On Wed, 2009-06-03 at 14:28 -0700, LaundroMat wrote: > Hi - > > I'm trying to change the way a ChoiceField (with widget = > forms.RadioSelect) is being rendered in a template. Currently, > rendering the form as_p() for instance, will return HTML such as: > > value="1" name="type" />choice 1 >

Re: Using alternating url patterns

2009-06-04 Thread Tom Evans
On Thu, 2009-06-04 at 05:01 -0700, janedenone wrote: > > On 3 Jun., 12:26, Tom Evans <tevans...@googlemail.com> wrote: > > On Wed, 2009-06-03 at 02:56 -0700, janedenone wrote: > > > Hi, > > > > > is it possible to use alternating url patterns without co

Accessing dictionaries in templates in a sorted manner

2009-06-09 Thread Tom Evans
Hi all I was struggling to turn a typical template dictionary iteration use case into a sorted dictionary iteration, and struggling to find any way of managing it. Eg: {% for key, val in tdict.items %}{% endfor %} After perusing docs, and the internet, it seemed like there was no

Re: Problem with query set order_by

2009-06-11 Thread Tom Evans
On Thu, 2009-06-11 at 09:04 -0700, Sean Brant wrote: > If I have 2 sql queries one with a limit of 5 and the other with a > limit or 6 they return there results in diffrent orders. > > Here is a example. > > >>> class Book(models.Model): > >>>title = models.CharField(max_length=150) > >>>

Re: Django unicode model pickle problem

2009-06-30 Thread Tom Evans
On Mon, 2009-06-29 at 13:05 -0700, Danny Davidson wrote: > I wouldn't consider myself an expert with Unicdoe, but I do know that > pickle and cPickle use ASCII for serialization. If you have utf-8 > characters stored as attributes in the object you're pickling, that > could cause the codec

Re: django memcached errors

2009-07-02 Thread Tom Evans
On Wed, 2009-07-01 at 18:38 -0400, Aaron Lee wrote: > Lately I have been seeing the following errors from memcached > > > [fa...@1246486554.949771] mcm_get_line():1542: memcache(4) protocol > error: no \r before \n > [fa...@1246486554.949771] mcm_get_line():1542: memcache(4) protocol > error:

Re: request body too long

2009-07-07 Thread Tom Evans
On Tue, 2009-07-07 at 03:02 -0700, Xu Mingming wrote: > When i post a request to my django server with a body of 28000 > characters, i got a 413 response(request body too long), anymore knows > how to increase this limit? > > BTW, i run the server using: > ./manage.py runserver > > thanks >

Re: How to execute more code after sending an HTTP response in a viewfunction?

2009-07-10 Thread Tom Evans
On Thu, 2009-07-09 at 13:19 -0700, Fluoborate wrote: > Hello All, > > I am afraid that I might have to write my own middleware to do this. I > really want to do something like the following: > > #In views.py: > > def welcome( request ): > return HttpResponse( "Welcome to my website" ) >

Re: Deployment Tool Recommendation

2009-07-15 Thread Tom Evans
On Wed, 2009-07-15 at 10:38 -0400, Shawn Milochik wrote: > I need to set up a one-click deployment from development to > production. What tool(s) are currently best-of-breed in the Django > community? Thanks in advance. > I use fabric, but its not exactly best of breed. It does the job

Re: Multiple Instances of Django

2009-07-15 Thread Tom Evans
On Wed, 2009-07-15 at 09:38 -0700, Caitlin Colgrove wrote: > I have two instances of django running under apache. One in /portal > and one in /beta/portal. They use two different code bases and two > different databases, although some of the data is replicated between > the two. If I am logged

Re: Accessing Form Data in Form Object

2009-07-16 Thread Tom Evans
On Thu, 2009-07-16 at 07:37 -0700, clea wrote: > Hello- > So I have the following issue and have not been able to find a > solution to it anywhere! I have the following ModelForm object: > > class OptionForm(ModelForm): > class Meta: > model = Option > > based on the

Re: How to access fields of custom intermediary table

2009-07-16 Thread Tom Evans
On Thu, 2009-07-16 at 08:30 -0700, mike wrote: > Hi, > > I have the following models: > > class Memory(models.Model): > partnum = models.CharField(max_length=30) > size = models.IntegerField() > > def __unicode__(self): > return self.partnum > > class

Re: Using the @login_required() decorator with #hash url's

2009-07-16 Thread Tom Evans
On Thu, 2009-07-16 at 16:00 +, Javier Guerra wrote: > On Thu, Jul 16, 2009 at 3:51 PM, Michael wrote: > > This information isn't transmitted to the server in anyway so short of what > > you described above, Django can't really solve your issue. > > but where is it

Re: better uptime with a fallback app

2009-07-22 Thread Tom Evans
On Wed, 2009-07-22 at 04:47 -0700, Graham Dumpleton wrote: > > > On Jul 22, 9:34 pm, Le Roux Bodenstein wrote: > > > If it is to bring down application for maintenance, seems like it > > > would be easier to use Apache/mod_wsgi in daemon mode. > > > > I'll give mod_wsgi a

Re: pdb session and auto-reload: input problem

2009-07-23 Thread Tom Evans
On Thu, 2009-07-23 at 14:11 +0100, Jeremy Sule wrote: > Hi everyone, > > I use pdb a lot and just drop "import pdb; pdb.set_trace()" here and > there in my code. > Often I find I have to change my code and do the change in the source > code and save it. > > The auto reload feature of django

Re: Howto not delete record after X days?

2009-07-28 Thread Tom Evans
On Tue, 2009-07-28 at 10:16 -0500, Keith Pettit wrote: > I need to be able to limit the ability to delete a record after it's > been in the system for X days. Any ideas on how to approach that? > > Basically I have a ticket system in Django, all works well with > add/edit/update/delete type

Re: Emailing a Application report automatically

2009-08-06 Thread Tom Evans
On Thu, 2009-08-06 at 00:38 -0700, Harish wrote: > Hi Friends, > > I am working on a application which is using django. I have some > reports in the application. Currently all the reports are displayed > in the tabular formats in HTML. I just got a new idea of mailing a > particular report. >

Re: Memory error

2009-08-06 Thread Tom Evans
On Wed, 2009-08-05 at 13:09 -0700, drakkan wrote: > The code is something like this > > obj=DBModels.objects.filter(somefilter) > results=[] > for o in obj: > results.append({'field1':o.field1,'field2':o.field2}) > > return JsonResponse(results) > > where JsonResponse is a class derived from

Re: Mysql commands and Django

2009-09-07 Thread Tom Evans
On Mon, 2009-09-07 at 05:25 -0700, Pythoni wrote: > I would like to use the output of mysql command in my templates, > e.g. Mysql command > show databases > will show all databases > e.g. > DB1, and DB2 > and I would like to add these > to > > > - > DB1 > DB2 > > > Is

Re: glibc detected

2009-09-11 Thread Tom Evans
On Fri, 2009-09-11 at 04:13 -0700, rufus nayagam wrote: > Often we get the following error. > > b79d5000-b79d7000 rw-p b79d*** glibc detected *** python: double free > or corruption (fasttop): 0x084dcaa8 *** > > We understand its a memory related error... And we give... > > export

Re: email : know wether address is valid

2009-09-15 Thread Tom Evans
On Tue, 2009-09-15 at 05:35 -0700, arbi wrote: > Hi there, > > I'd like to know wether an email sent with Django to exam...@gmail.com > has arrived or not (and know if the email address is valid). How can I > know this ? > > Thx > Send them an email with a link containing a token in it. When

Re: How to define a "has-a" relationship in dJango models

2009-09-17 Thread Tom Evans
On Wed, 2009-09-16 at 17:15 -0500, Javier Guerra wrote: > On Wed, Sep 16, 2009 at 1:01 PM, PlanetUnknown > wrote: > > > > Thanks Karen. > > Let me explain it a bit more. > > e.g. > > All CONTACT details are present in one table - email, home address, > > work address,

Re: Formset

2009-09-17 Thread Tom Evans
On Thu, 2009-09-17 at 03:58 -0700, mag wrote: > Hello, > > I'm novice in Django and I' would like to create an edition formset to > edit questions, for example. I' already have a formset to add > question: > > My add formset : > > def manage_polls(request): > PollFormSet =

ModelForm refuses to save instance

2009-09-18 Thread Tom Evans
Hi all. I have a model form to update two attributes on a UserProfile. The form is simple: class UserProfileSetRememberMeForm(forms.ModelForm): DURATION_CHOICES = ( ( 0, 'Default (2 weeks)'), ( 1 * 7 * 24 * 60 * 60, '1 week'), ) YESNO_CHOICES = ( (0, 'No'), (1, 'Yes'), )

Re: Can I tell IE not to cache data?

2009-09-18 Thread Tom Evans
On Thu, 2009-09-17 at 16:35 -0700, mediumgrade wrote: > I have several views which generate some JSON data. They all end > something like this: > > response = HttpResponse(pie_data, mimetype='application/json') > response['Content-Disposition'] = 'attachment; > filename=my_pie_chart.json' > >

Re: ModelForm refuses to save instance

2009-09-18 Thread Tom Evans
On Fri, 2009-09-18 at 06:53 -0700, Daniel Roseman wrote: > On Sep 18, 1:01 pm, Tom Evans <tevans...@googlemail.com> wrote: > > Hi all. I have a model form to update two attributes on a UserProfile. > > > > The form is simple: > > > > class UserP

Re: ModelForm refuses to save instance

2009-09-18 Thread Tom Evans
On Fri, 2009-09-18 at 15:29 +0100, Tom Evans wrote: > On Fri, 2009-09-18 at 06:53 -0700, Daniel Roseman wrote: > > On Sep 18, 1:01 pm, Tom Evans <tevans...@googlemail.com> wrote: > > > Hi all. I have a model form to update two attributes on a UserProfile. > &

Re: How can I refresh iframe use the django?

2009-09-22 Thread Tom Evans
On Tue, 2009-09-22 at 21:41 +0800, List Mail wrote: > When something changed, I want refresh iframe page and pass some > values to the iframe > > such as when addMethod(a, b) is invoked, the iframe will be refreshed > and use the parameter a and b > > def addMethod(a, b) > //need refresh

Re: File storage: Filesystem vs Database

2009-09-22 Thread Tom Evans
On Tue, 2009-09-22 at 08:12 -0700, Charles Wang wrote: > I have a question for "make apache deliver it". How to control the > access right? Integrate apache access auth model with Django? > > On Sep 22, 10:37 pm, Javier Guerra wrote: > > On Tue, Sep 22, 2009 at 8:09 AM,

Re: dJango updating fields which are not being set

2009-09-22 Thread Tom Evans
On Tue, 2009-09-22 at 08:13 -0700, PlanetUnknown wrote: > I'm sure I'm missing something simple here, since its a common flow - > > 1.) e.g. model Person - has 4 fields - > person_id = models.AutoField(primary_key=True) > person_name = models.CharField(max_length=50) > comments =

Re: too many joins

2009-09-24 Thread Tom Evans
On Thu, 2009-09-24 at 06:25 -0700, blumenkraft wrote: > Hi, > > It seems that Django generates too many joins with chained filters: > > class Issue(models.Model): > is_opened = models.BooleanField() > > class Advertisement(models.Model): > issues = models.ManyToManyField(Issue, null = True)

Re: many to many add by ids

2009-09-30 Thread Tom Evans
On Tue, 2009-09-29 at 16:16 -0700, rich.al...@gmail.com wrote: > I have the following I'm trying to optimize. > > Input (from the web) is > > sids = "1,2,3,5" (a list of ids is posted, say they are article ids) > > Now, to add them to a many to many, I'd like to just > > try: >

Re: Two Formset on the same page

2009-10-01 Thread Tom Evans
On Thu, 2009-10-01 at 07:26 -0700, Val Makykh wrote: > Hello all. > > I use Django 1.1. > > I try to make two formsets on the same page. > But when I'm trying to use the data from POST, I have such problem: > from POST each formset takes only first form with value. Where have I > mistaken?

Re: Two Formset on the same page

2009-10-01 Thread Tom Evans
add_prefix(name)) > File "C:\Python26\lib\site-packages\django\forms\widgets.py" in > value_from_datadict > 170. return data.get(name, None) > > Exception Type: AttributeError at /results/2/1/ > Exception Value: 'str' object has no attribute 'get' >

Re: "manage.py syncdb" fails when called via SCons

2009-10-05 Thread Tom Evans
On Mon, 2009-10-05 at 15:52 +0200, Ralph Heinkel wrote: > Hi, > > We have an automatic build system with scons and through this we want > to initialize djangos tables. > > This is a weird problem: > - If I run "python manage.py syncdb" from my unix shell, >all tables are nicely created. >

Re: "manage.py syncdb" fails when called via SCons

2009-10-05 Thread Tom Evans
On Mon, 2009-10-05 at 09:02 -0700, Ralph Heinkel wrote: > Hi, > > I just checked the environment for PYTHONPATH, it is neither set in > the parent nor in the subshell. > > Actually, I can reduce the problem to this: > > 1. In my unix shell I start the python interpreter > 2. in Python:

Re: Django with Cherokee web server

2009-10-08 Thread Tom Evans
On Wed, 2009-10-07 at 23:54 +0100, Oli Warner wrote: > People quite happily run Django on memory starved VPS systems > using > Apache/mod_wsgi with optional nginx front end for static > files. > > Apache is woefully slow and inefficient at static serving. A static

Re: ModelForm

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 00:04 -0700, luca72 wrote: > Hello this is my model: > from django.db import models > > > class Per(models.Model): > dip = models.CharField(max_length=100) > data_ini = models.CharField(max_length=100) > data_fin = models.CharField(max_length=100) > mot =

Re: ModelForm

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 13:27 +0300, Bogdan I. Bursuc wrote: > I'm sorry, but i still can't figure out where the error comes. > Can you post your traceback from the error page ? > The error comes because he misspelled 'class Meta' as 'class meta'. >>> class profilemodelform(ModelForm): ...

Re: Django with Cherokee web server

2009-10-08 Thread Tom Evans
On Thu, 2009-10-08 at 16:23 +0100, Oli Warner wrote: > FUD. You just think it is slow and inefficient because you > have never > configured it correctly. > > Analogy time. Gather round, children. > > You buy a car. The dealer said it can do 0 to 60mph in five seconds >

Re: regex infinite loop with 100% cpu use in django.forms.fields.email_re - DOS hole?

2009-10-12 Thread Tom Evans
On Fri, 2009-10-09 at 12:21 -0700, davisd wrote: > Sorry for the public disclosure... I did email django security after > I posted. I'm just getting into this open source goodness and I'm not > really sure how it's supposed to operate yet. > > I did consult the documentation: >

Re: displaying fields from 2 related models

2009-10-13 Thread Tom Evans
On Tue, 2009-10-13 at 07:23 -0700, grimmus wrote: > Hi, > > I have a model called Link that allows the user to save a URL with a > title and description. The website i am making is full of Links users > have added (like a bookmarking service) > > class Link(models.Model): > user =

Re: request.META['REMOTE_USER']

2009-10-14 Thread Tom Evans
On Wed, 2009-10-14 at 02:29 -0700, luca72 wrote: > Hello if i use request.META['REMOTE_USER'] i get key error, but if i > use 'REMOTE_HOST' not > can you tell me how to get the user that is authenticate > I use the decorator @login_required and so the user is authenticated > correct? > > Regards

Re: using ajax with django

2009-10-19 Thread Tom Evans
On Mon, 2009-10-19 at 03:41 -0700, neetu wrote: > Thanks a lot. > > Can u tell me how can i make ajax connections. > http://lmgtfy.com/?q=make+ajax+request Cheers Tom --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Redirects on HTTPS

2009-10-22 Thread Tom Evans
On Thu, 2009-10-22 at 12:45 +0100, Tim Sawyer wrote: > Hi, > > I have a django app that works fine using http. We have a requirement to > serve the entire site using https, which is being done at the proxy level > - so the Apache that my django is running inside (mod_wsgi) doesn't know > about

Re: Advantages of using ManyToManyField(Bar, through='Foo_Bar') syntax vs not declaring a ManyToManyField at all

2009-10-22 Thread Tom Evans
On Thu, 2009-10-22 at 07:57 -0700, Monika Sulik wrote: > Hi, > > I was wondering what exactly are the advantages of having code like > this: > > >> > class Foo (models.Model): > bar_m2m = models.ManyToManyField(Bar,through='Foo_Bar') > > class Bar

Re: nginx, apache, and odd admin error

2009-10-24 Thread Tom Evans
On Fri, 2009-10-23 at 10:05 -0700, rd-london wrote: > > On a slightly separate note - forgetting the reverse proxy arrangment > for a moment, how would one serve admin on a separate port? > > Thanks for any help, > R Can't help with the other bit, but - in apache or nginx? In apache you'd

Re: Foreign Key Admin UI Error (from a new user)

2009-10-24 Thread Tom Evans
On Fri, 2009-10-23 at 13:22 -0700, David Nolen wrote: > My admin looks something like the following- > > class TitleInline(admin.TabularInline): > model = Title > extra = 1 > > class WorkAdmin(admin.ModelAdmin): > inlines = [TitleInline] > admin.site.register(Work, WorkAdmin) > >

Re: Db migration

2009-10-26 Thread Tom Evans
On Mon, 2009-10-26 at 16:09 +0530, aju mathew wrote: > Hi > > How can I populate values from a python file to database. > > Is it any commands their for db migration from command prompt. > > -- > Thanks & Regards, > Aju P Mathew > http://docs.djangoproject.com/en/dev/howto/initial-data/

Re: Django templates, break a for after an if

2009-10-26 Thread Tom Evans
On Mon, 2009-10-26 at 15:54 +0200, Jani Tiainen wrote: > NMarcu kirjoitti: > > Hello all, > > > >I want to do something like this: > > > > {% for u in users %} > > {% for su in superu %} > > {% ifequal u su %} > >//do

Re: Login over HTTPS

2009-10-27 Thread Tom Evans
On Tue, 2009-10-27 at 07:58 +0200, Jani Tiainen wrote: > I'm trying to get Django to make authentication (namely username + > password) to be transferred over HTTPS. But rest of the site is still on > plain old HTTP. > > How this can be done? I've very little success and google didn't gave >

Re: GROUP results in views.py

2009-10-30 Thread Tom Evans
SQL cant do this, so do it in python... items = ItemOwned.objects.filter(user=id) data = { } for item in items: cur_set = data.get(item.setId, {'setId': item.setId, 'items':[]}) cur_set['items'].append({'id': item.id, }) data[item.setId] = cur_set return

Re: Display Certain Fields of the Model Formset As Text

2009-10-30 Thread Tom Evans
When you iterate through the fieldset, you should be iterating through form instances. Because they are forms from a ModelFormSet, they will be ModelForm instances, and so will have an instance attribute that you can use to output the fields you don't want in the form. You can then restrict the

Re: Display a value from another table

2009-11-02 Thread Tom Evans
On a Book instance, the 'authors' attribute is a manager, so Tim's examples should read: {% for book in books %} {{ book.name }} {% for author in book.authors.all %} {{ author }} {% endfor %} {% endfor %} or in Python code: book = Book.objects.get(id=42) for

Re: How can we capture the login time in Django

2009-11-03 Thread Tom Evans
http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.models.User.last_login If you need more fine grained control/history, then you control the points where login and logout occur. Simply add logging at the appropriate points. On Tue, Nov 3, 2009 at 9:30 AM, vishak

Re: Force template rendering in specific language

2009-11-03 Thread Tom Evans
from django.utils import translation translation.activate(language_code) On Tue, Nov 3, 2009 at 10:43 AM, Till Backhaus wrote: > > Hi django-users, > > how can i force django to render a template in a specific language? > > Consider this simple piece of code: > > t =

Re: REST failed urlopen

2009-11-03 Thread Tom Evans
How are you running django? Are you going to a view at /client/, which then tries to access a different view using urllib? IE, from the view at /client/, are you trying to access the same server as you are running on? Remember that the django 'runserver' web server is single threaded, single

Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Tom Evans
On Wed, Nov 4, 2009 at 9:50 AM, NMarcu wrote: > > Hello all, > > I got an error, and I don't know how to pass on it. I got this > error when I try to use ajax from django templates. > I use this, from jquery: > $('#create-user').click(function() { >$(

Re: How to use French accent on django template?

2009-11-12 Thread Tom Evans
On Thu, Nov 12, 2009 at 4:30 PM, rebus_ wrote: > 2009/11/12 NMarcu : > > Hello all, > > > > How to use French accent on django template? It's very strange. in > > one template is working very well, but in other(templatetag) not, I > > got this

Re: Making the case for Django (vs. Drupal)

2009-11-16 Thread Tom Evans
On Mon, Nov 16, 2009 at 5:25 AM, Melvyn Sopacua < msopa...@warp10.thruhere.net> wrote: > On Mon, 16 Nov 2009 08:53:26 +0530, Kenneth Gonsalves > wrote: > > On Monday 16 Nov 2009 6:50:10 am Christophe Pettus wrote: > >> On Nov 15, 2009, at 5:10 PM, Kenneth Gonsalves wrote: > >>

Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
Hi all I'm encountering a difficult to solve unicode problem whilst saving data to the database. Worst of all, any attempt to reduce it to a simple test case, or reproduce it in the console fail(!). This is on django 1.0. The process encountering the error is a simple daemon, run from a

Re: MySQL error subquery returns more than 1 row

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:17 PM, Ilya wrote: > I just developed some code like: > MyModel.objects.filter(key_to_mymodel2 = MyModel2.objects.all())) > This query produce SQL: > SELECT * FROM `test_mymodel` WHERE key_to_mymodel2_id =(select `id` > from `test_mymodel2`) >

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:34 PM, dfolland wrote: > I've dealt with this by manipulating the data with Python codecs. > > import codecs > > new_value= codecs.decode(current_value, 'utf-8', 'ignore') > > the default option is 'strict' which will raise a ValueError that >

Re: Template tag to check if object in queryset

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 4:07 PM, dadapapa wrote: > Dear list, > > I have two models that are in the following relationship: > > class Member(django.contrib.auth.models.User) : ># some app specific stuff here >pass > > class Event(django.db.models.Model) :

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 3:14 PM, Tom Evans <tevans...@googlemail.com> wrote: > Hi all > > I'm encountering a difficult to solve unicode problem whilst saving data to > the database. Worst of all, any attempt to reduce it to a simple test case, > or reproduce i

Re: Unicode heisenbug whilst running a management command

2009-11-17 Thread Tom Evans
On Tue, Nov 17, 2009 at 7:35 PM, Karen Tracey <kmtra...@gmail.com> wrote: > On Tue, Nov 17, 2009 at 1:12 PM, Tom Evans <tevans...@googlemail.com>wrote: > >> This appears to be some sort of issue between the mysqldb and django's >> templating sys

Re: how to run django with fastcgi, but not run as user "root" on linux

2009-11-18 Thread Tom Evans
On Wed, Nov 18, 2009 at 8:25 AM, Fm wrote: > Hi all, > I have write a script in /etc/rc.d/init.d so that Django can start > with my server. > It may look like > start () { >echo -n $"Starting $prog: " > /usr/local/bin/python /home/admin/cc/manage.py runfcgi

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
On Tue, Nov 24, 2009 at 4:40 PM, Gloria wrote: > Hi all, > > I am using the SettingsBackend sample code, from here: > > > http://docs.djangoproject.com/en/dev/topics/auth/#django.contrib.auth.authenticate > > in Django 1.1.1, python 2.6, and I get this error: > > TypeError

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
What does the traceback look like? Cheers Tom -- 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

Re: custom backend causes this error: authenticate() takes exactly 0 arguments (2 given)

2009-11-24 Thread Tom Evans
On Tue, Nov 24, 2009 at 5:28 PM, Gloria wrote: > Traceback: > File "/usr/lib/python2.6/site-packages/Django-1.1.1-py2.6.egg/django/ > core/handlers/base.py" in get_response > 92. response = callback(request, *callback_args, > **callback_kwargs) > File

Re: Why are collapsed fieldsets expanded on submit in the admin?

2009-11-25 Thread Tom Evans
On Mon, Nov 23, 2009 at 3:57 PM, Benjamin Wohlwend wrote: > Hi, > > currently, when a form in the admin has collapsed fieldsets, those > fieldsets are expanded on submit. As I find this rather distracting > and couldn't find an explanation why this should be desired behavior,

Re: import twice when run test

2009-11-26 Thread Tom Evans
On Thu, Nov 26, 2009 at 2:35 AM, fallhunter wrote: > i have this code in my tests.py: > > from models import * > > and in the models.py I have a signal handler and register it with > > post_save.connect( post_save_note, sender=Note ) > > and when i run test with

Re: string-based fields and null

2009-11-26 Thread Tom Evans
On Thu, Nov 26, 2009 at 2:25 PM, chefsmart wrote: > Those are good points. I am inclined to think the Django developers > think along the same lines (that is why they suggest to "Avoid using > null on string-based fields such as CharField and TextField unless you > have

Re: db_index = True on BooleanField (MySQL)

2009-11-26 Thread Tom Evans
On Thu, Nov 26, 2009 at 2:35 PM, chefsmart wrote: > I had a fruitless discussion with a fellow coder today. Summarily, we > have a model for students that will keep growing with time. I mean to > say the number of records in the database will keep growing, and no > rows

Re: Ajax with jquery, 2 load in the same event, work not OK on apache2 server...strange because work ok with runserver, on localhost

2009-11-27 Thread Tom Evans
On Fri, Nov 27, 2009 at 8:08 AM, NMarcu wrote: > Hello all, > >I have something like this: > > $( '#operators_list_div' ).html( '' ).load( '{% url > add_save_view %}',{'action':'action',}); > $( '#address_list' ).html( '' ).load( '{% url add_save_view %}', >

Re: style guide/autoformatter/linter for Django templates?

2009-12-01 Thread Tom Evans
On Tue, Dec 1, 2009 at 7:33 AM, Steve Howell wrote: > Just following up on this a few days later, in case it got lost in the > shuffle due to the weekend and U.S. holiday. > > On Nov 27, 2:18 pm, Steve Howell wrote: >> I am wondering if there is a style

Should empty formsets call their own clean method?

2009-12-01 Thread Tom Evans
Hi all We encountered a strange issue today. When a user submits a formset that is empty, we call is_valid() on the formset, expecting the clean() method to be called. We then subsequently get errors later on, because the formset did not call self.clean(), and therefore it did not populate the

  1   2   3   4   5   6   7   8   9   10   >