Re: Creating forms

2009-08-25 Thread Alex Gaynor
t; > > Cheers > > tom > > > > Take a look at formsets: http://docs.djangoproject.com/en/dev/topics/forms/formsets/ Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire "The people's good is the highes

makemessages clutters project locale files with strings from already translated apps

2009-08-26 Thread Alex Rades
Hi, I have many applications in my project. I've carefully translated them launching manage.py makemessages from within each application directory, so that each app has its own locale/ directory with translations. When it comes to translating project-level strings, and I launch makemessages from

Re: show user and date in change_list

2009-08-27 Thread Alex Gaynor
#x27;] > > >> >> But both functions returns (None). Why I can do it? >> >> > > > > > You can't have methods with the same names as fields on your models, since this would mean an object having two attributes by the same name. Alex -- "I disa

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
cache which is holding all the rows > retrieved by the query.  Is there any way to turn this cache off?  Looking > at the code leads me to think no, but I thought I'd ask. > > -sam > > > > > Instead of iterating over the QuerySet itself, use QuerySet.iterator(), this

Re: QuerySet without result_cache?

2009-08-27 Thread Alex Gaynor
On Thu, Aug 27, 2009 at 5:56 PM, Sam Tregar wrote: > On Thu, Aug 27, 2009 at 5:47 PM, Alex Gaynor wrote: >> >> Instead of iterating over the QuerySet itself, use >> QuerySet.iterator(), this will avoid populating the result cache. > > Thanks, works great!  This would

Re: Execute code after sending a http response?

2009-08-28 Thread Alex Robbins
You'll have to set something in a table and run a cron to send it later. Django-mailer [1] has all of this set up for, along with some other cool features. I've used it in a project before and been happy with it. [1] http://code.google.com/p/django-mailer/ On Aug 28, 1:10 am, Shadow wrote: > Hi

Re: Django and SSL Deployment using mod_wsgi

2009-08-29 Thread Alex Robbins
You'll probably want to look into something like this: http://www.djangosnippets.org/snippets/880/ It allows you to set some urls to redirect so they are always https. Otherwise those silly users will go to credit card pages without https. On Aug 29, 1:04 am, Vitaly Babiy wrote: > Hey guys, > W

Re: Advice on Subclassing a TextField

2009-08-29 Thread Alex Gaynor
>     return super(HtmlField, self).formfield(**kwargs) > >     def __init__(self, *args, **kwargs): >     super(HtmlField, self).__init__(*args, **kwargs) > > > > > The biggest thing is there is no need to rewrite the __init__ method if you aren't chang

Re: Advice on Subclassing a TextField

2009-08-30 Thread Alex Robbins
Also, maybe you aren't submitting all the code, but you could do the same thing by just passing an attrs dictionary to the text area widget. http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms.Widget.attrs Not sure that this requires two more classes. Hope that helps,

Re: Django searching for admin template in admindocs directory

2009-08-30 Thread Alex Gaynor
gt;    (r'^admin/', include(admin.site.urls)), >    (r'^articles/', include('oslaurier.articles.urls')), > ) > > -- > > I noticed that for some reaso

Re: Getting all unique values of a field with Django ORM

2009-08-30 Thread Alex Gaynor
> do this with the Django ORM. > > Thanks for any thoughts on this, > > Stephen > > > LinkBack.objects.values_list('target_url', flat=True).distinct() should do what you want. Alex -- "I disapprove of what you say, but I will defend to the death your right to

Re: How do you remove fields from a subclassed form?

2009-08-31 Thread Alex Gaynor
;field2') > > For some reason, I can't get field2 removed from the subclassed form. > If I subclass AnotherForm from ModelForm, field2 will be removed, but > then I lose all my customizations from MyForm... > > > The answer is you don't. You change the inheritanc

Re: Defining subsets of "list" variable at template level

2009-08-31 Thread Alex Robbins
First, if you aren't running into db performance problems, I wouldn't optimize. Keep everything as simple as possible, then optimize the parts that actually demonstrate themselves to be a performance issue. If this really is a performance issue, you could solve it like this: If you know that you

Re: Django and SSL Deployment using mod_wsgi

2009-09-01 Thread Alex Robbins
tally going to http://mysite/credit_card_form/ will be redirected to https:// I'm guessing that overriding the wsgi.url_scheme is meant to handle that, but I don't understand how. Thanks, Alex On Aug 31, 6:02 pm, Graham Dumpleton wrote: > On Sep 1, 3:39 am, Francis wrote: >

Re: FormWizard: how to pass in extra keyword arguments into a form's __init__?

2009-09-01 Thread Alex Robbins
I guess the question is when you know the additional keyword argument. If you already know what that extra keyword is when you are constructing the form list, you could use a partial[1] to put in the arguments you know already. Partials are python 2.5+ only, you can use a lambda instead if you are

Re: name error not defined in models

2009-09-01 Thread Alex Gaynor
class Dek(models.Model): >    ank = models.ManyToManyField(Ank) > > How come I got "NameError: name 'Dek' is not defined" when running > runserver > > > > > > Take a look at: http://docs.djangoproject.com/en/dev/ref/models/fields/#lazy-relationships Alex

Re: QuerySet cache

2009-09-06 Thread Alex Gaynor
call .iterator() on the QuerySet and it will hvae it's cache disabled. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Voltaire "The people's good is the highest law." -- Cicero "Code can always be sim

Re: haml + sass + django

2009-09-09 Thread Alex Robbins
You might look at http://sandbox.pocoo.org/clevercss/, which is python based. On Sep 8, 9:19 am, ThinRhino wrote: > Hello, > > I just came across haml and sass, but looks like it is built for Ruby on > Rails. > > Any implementation that can work on Django? > > Though I also came acrosshttp://bit

Re: Why won't my form validate?

2009-03-24 Thread Alex Gaynor
nces: > > > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-sav... > > > > -- dz > > > > On Tue, Mar 24, 2009 at 3:21 PM, Theme Park Photo, LLC > > > > wrote: > > > > > Error fields were all empty. I checked methods non_field_erro

Re: Bug report: Model.get(pk=None)

2009-03-24 Thread Alex Gaynor
On Tue, Mar 24, 2009 at 8:15 PM, Michael Glassford wrote: > > Alex Gaynor wrote: > > > > > > On Tue, Mar 24, 2009 at 2:51 PM, Michael Glassford wrote: > > > > > > Alex Gaynor wrote: > > > > > > > > > On Tue

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
oesn't have a public API for mulitple databases so it could be harder, but there is both private APIs and external tools like PgPool. However, what's the real question you're trying to answer? 100% of websites don't get traffic that approaches facebook. Alex -- "I disap

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: > > Curse (http://www.curse.com/) manages to stay up on WoW patch day, so > that's a pretty good sign. > > > > Curse is no longer running on Django(it's ASP.net now I think), no idea if that was a technical

Re: What's the most scalable Django deployment out there currently?

2009-03-24 Thread Alex Gaynor
On Wed, Mar 25, 2009 at 1:06 AM, Graham Dumpleton < graham.dumple...@gmail.com> wrote: > > > > On Mar 25, 3:45 pm, Alex Gaynor wrote: > > On Wed, Mar 25, 2009 at 12:43 AM, Adam V. wrote: > > > > > Curse (http://www.curse.com/) manages to stay up on WoW p

Re: ImageField on ModelForm not working - v1.0.2

2009-03-25 Thread Alex Koshelev
You don't pass request.FILES to form constructor [1] [1]: http://docs.djangoproject.com/en/dev/ref/forms/api/#binding-uploaded-files-to-a-form On Wed, Mar 25, 2009 at 3:45 PM, Oli Warner wrote: > > I'm having a massive headache. I have a Model called companies with > vaious fields but for one

Re: has_add_permission() isn't working properly

2009-03-25 Thread Alex Gaynor
useful if you could write it up so it's not forgotten. >> >> Karen >> > > -- > João Olavo Baião de Vasconcelos > Bacharel em Ciência da Computação > Analista de Sistemas - Infraestrutura > joaoolavo.wordpress.com > > > > I've closed this as a d

Re: DjangoBook forms

2009-03-25 Thread Alex Gaynor
t; Thanks > > Andrew > > > Well, you've only put a snippet there, but this is just python so if you have a syntax error you diagnose it as normal, but I suspect you're missing the ':' at the end of the line. Alex -- "I disapprove of what you say, but I wi

Re: What to use: release or development?

2009-03-25 Thread Alex Gaynor
from before the 1.0, when many new features had gone in. For now, unless you need a specific feature from the beta, I would reccomend just using 1.0.2. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is

Re: Missing features on Django ORM (Query Cache, Persistant Connexion/Connexion Pool)

2009-03-25 Thread Alex Gaynor
tity mapper isn't appropriate for Django. 2) This one is less clear, and I don't know that there's any consensus however it's possible to use external connection poolers with Django(like PgPool). Alex -- "I disapprove o

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Alex Gaynor
winner, ruling by fiat is generally not the conflict resolution strategy for the core devs, so none of them would be included until there is a clear winner. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.&q

Re: will dmigrations be merged into django codebase?

2009-03-25 Thread Alex Gaynor
gt; > Well there have been external Django application that do schema evolution for quite some time, what there hasn't been is a consensus on how it should look, so until we have them including anything in Django would therefore disappoint a decent percentage of the community. Alex -- &quo

Re: Django and IIS 7

2009-03-26 Thread Alex Gaynor
net-and-in-cloud.html >>> >>> adi >>> >>> >>> >> >> >> -- >> If you spin an oriental man, does he become disoriented? >> (-: ¿ʇɥǝɹpɹǝʌ ɟdoʞ uǝp ɹıp ɥɔı ,qɐɥ 'ɐɐu &g

Re: Conditional Inline in admin interface

2009-03-26 Thread Alex Gaynor
le from what already exists? > > Thanks! > > > > You should be able to do it by overiding the get_formsets method on the ModelAdmin: http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L357 Alex -- "I disapprove of what you say, but I will defe

Re: src-Path for .js or .img - Files in a Django-Project

2009-03-27 Thread Alex Gaynor
ot;src=..." to reach this .js-File. > Problem of not enough understanding of Djangos-URL-Structure. > > Please -give me some hints. > > And I know about {% include %} - Tag. > > Thx > Timothy > > > Take a look at this: http://docs.djangoproject.com/en/dev/how

Re: Design Issue / forward referencing

2009-03-28 Thread Alex Gaynor
ard referencing ? how do I solve it ? > > Thx/Mahesh. > > > > > To do references to the same model you do ManyToManyField('self'). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people

Re: Design Issue / forward referencing

2009-03-28 Thread Alex Gaynor
On Sat, Mar 28, 2009 at 10:14 PM, mahesh wrote: > > Hi Alex, > > Solution given by by as worked :) However I wonder how come 'self' > worked against self (without quotes) > > Thank You > -Mahesh/ > > On Mar 28, 8:57 pm, Alex Gaynor wrote: > > O

Re: QuerySet.only()?

2009-03-30 Thread Alex Gaynor
; > > > > def queryset_only(self): > > > i = len(self) > > > if i == 0: > > >return None > > > elif i > 1: > > >raise Exception("More than one element in this querySet!!") > > > else: > > >return

Re: QuerySet.only()?

2009-03-30 Thread Alex Gaynor
n Tracey wrote: > > I think you missed get_or_create: > > > > http://docs.djangoproject.com/en/dev/ref/models/querysets/#get-or-cre... > > > > Karen > > Alex, > > The problem with that is that it's not DRY enough for my taste. Before > doing that, I

Re: How would you code a template to do this (template logic)

2009-03-30 Thread Alex Gaynor
ter|module:10 %} > >{% endif %} > > Regards, > Malcolm > > > > > Or you can just use the builtin divisibleby filter(basically the same way as malcolm's minus the negation). Alex -- "I disapprove of what you say, but I will defend to the

Re: how to compare numeric in template?

2009-03-31 Thread Alex Gaynor
2009/3/31 ketu.lai > > hii want to compare numeric in template. just like less than,greater than > etc. and how can i do? or other solutions? > -- > 有没有听过盲人摸象的故事,没有的话大神说给你听! > > > > Take a look at django-template-utils which has templatetags for all these things. Alex

Re: Determining server identity from views.py?

2009-03-31 Thread Alex Gaynor
f apache_mod_python: > do this > > Thanks for any hints... > Ross. > > > > > Not that I can think of, your best bet is probably to have a CURRENT_ENVIRON settings or something that you just set locally to whatever the current evniroment is(there are tons of articles on d

Re: ModelForm

2009-03-31 Thread Alex Gaynor
quot; there's been a lot of discussion on it and I don't want to repeat it all :) If you have any questions after reading that feel free to follow up. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people'

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Alex Gaynor
o pode > pertencer a uma subcategoria de si própria. Seleccione Categoria Pai > diferente.') > return self.cleaned_data > > Help? > > > > First call the parent class's clean method, then do your own validation. Alex -- "I disapprove of what you

Re: Unique Constraint validation on admin fails when declaring clean() method

2009-03-31 Thread Alex Gaynor
On Tue, Mar 31, 2009 at 11:01 PM, Ricardob wrote: > > I'm sorry if this is too basic, just starting on django. > > How do I call the default clean method? Am I not overriding it by > defining on ModelForm? > > On Apr 1, 3:35 am, Alex Gaynor wrote: > > On Tue, M

Re: evaluation of checkboxes

2009-04-01 Thread Alex Gaynor
POST: > st = "" > for x in request.POST['stat]': > st = st + x -> same result > "B" and not "123AB" > > How can I get the whole list/string to save it in my database? > > Thx >

Re: admin permissions i18n

2009-04-01 Thread Alex Gaynor
nt. Django itself does not provide any > > localisation of database content. Maybe one day, but not today. > > > > Regards, > > Malcolm > > > Nope, django doesn't handle i18n for any string stored in the DB, there are a couple of external projects that do it though.

Re: Images dose not upload , unless it the admin !

2009-04-01 Thread Alex Gaynor
!!! > > i don't know exactly what is wrong , which display this error : > > " Caught an exception while rendering: The +attribute has no file > associated with it. " > > Any help ! > > Regards > > > > > Are you properly setting the enctype on the HT

Re: Performance Issue: ForeignKey will touch database again!

2009-04-01 Thread Alex Koshelev
On Thu, Apr 2, 2009 at 10:36 AM, Zeal wrote: > > Hi, All, > [skip] > > Does every body know this issue and know how to solve it? Your any > suggestion or solution will be highly appreciated! > > Regards, > > Zeal > Documentation knows [1] [1]: http://docs.djangoproject.com/en/dev/ref/models/que

Re: What is the best way to extend the User Model

2009-04-02 Thread Alex Gaynor
s > > > Yes, the OneToOneField is still the prefered way to extend the user model, the issue with select related is the subjct of ticket #7270. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the

Re: RSS producing wrong link from get_absolute url

2009-04-02 Thread Alex Koshelev
Have you changed your `Site` model entry to the proper port number? On Fri, Apr 3, 2009 at 2:23 AM, John Baker wrote: > > I have a strange problem with simple RSS feeds. It works fine locally > on my development machine but when I deploy to the test server running > through mod_python on port :8

Re: Django db profiler

2009-04-03 Thread Alex Gaynor
I can't find something similar in django. >> >> >> > > > > Also take a look at the django-debug-toolbar(on github), it has a panel for seeing what SQL queries were excecuted(and abut a dozen other things). Alex -- "I disapprove of what you say, but I will de

Re: Struggling to Get a Model/View/Django to work

2009-04-03 Thread Alex Gaynor
aphorically, that is). > > > 2 things. One the get_object_or_404 isn't necessary since request.user is already the user object, there's no need to query for it again. Second the reason you always get an INSERT is that you are constructing a new object, perhaps you should

Search in multiple models

2009-04-03 Thread Alex Rades
Hi, I'm developing a simple site which has 2 basic models: Article and StaticPage (not using flatpages since i have some custom fields attached). Now, I need to create a search form which should search among both articles and static pages and return the list of matches. I'd like very much to retu

Re: No module named admin.site.urls

2009-04-03 Thread Alex Gaynor
/', include(admin.site.urls)), > What can i do? Please help me. > > > > what version of Django are you running? If you're using 1.0.X you should 1.0.X docs, not the development version docs. Alex -- "I disapprove of what you say, but I will defend to the death your rig

Re: No module named admin.site.urls

2009-04-03 Thread Alex Gaynor
On Fri, Apr 3, 2009 at 4:59 PM, Rosemarie Loewe wrote: > Hi Alex, > > > > I had the same problem, it must be an error in tutorial. Following works: > > > > (r'^admin/', include(admin.site.root)), > > > > > > Best Regards > > Rose

Re: url pattern - allow null

2009-04-03 Thread Alex Gaynor
#x27;, 'content.views.page'), > > If i leave of the arg, then it won't match when this is > present. Are you supposed to have a url line for every single thing > you want to do to an object? > > > That's how I do it, since I have separate view functions for ea

Re: Cannot reverse inside urls.py

2009-04-03 Thread Alex Gaynor
t's > some way off into the future. There's pretty much always a workaround or > better solution. > > Regards, > Malcolm > > > > > > A lazy reverse shouldn't be too difficult to implement in your own code though: from django.utils.functional impor

Re: No module named admin.site.urls

2009-04-03 Thread Alex Gaynor
On Fri, Apr 3, 2009 at 9:13 PM, atik wrote: > > Thanks both of you. > @Rosemarie > It doesn't work. > @Alex > I use the latest stable version 1.0.2. Plz do something so i can do it > successfully. > I have trying this tutorial > http://docs.djangoproject.co

Re: Cannot reverse inside urls.py

2009-04-03 Thread Alex Gaynor
On Fri, Apr 3, 2009 at 9:32 PM, Malcolm Tredinnick wrote: > > On Fri, 2009-04-03 at 21:07 -0400, Alex Gaynor wrote: > [...] > > A lazy reverse shouldn't be too difficult to implement in your own > > code though: > > > > from django.utils.functional impor

Re: MySQLdb for Python 2.6 on win32

2009-04-03 Thread Alex Ehlke
THANK YOU SO MUCH. Saved me a lot of time and frustration. On Feb 8, 6:46 pm, Technicalbard wrote: > If you are looking for this, I compiled it using MSVC++2008 Express, > against MySQL 5.0.67 using Python2.6and theMySQLdb1.2.2 source: > > http://www.technicalbard.com/files/MySQL-python-1.2.2.wi

Re: Sqlite3 database fail

2009-04-04 Thread Alex Gaynor
y > -rw-r--r-- 1 xxx xxx 546 2009-04-04 13:31 manage.py > -rw-r--r-- 1 xxx xxx 2765 2009-04-04 13:31 settings.py > -rw-r--r-- 1 xxx xxx 529 2009-04-04 13:31 urls.py > x...@xxx:~/Django/p2$ > > Doest matter if i run it with sudo rights or not. > > Alan > > > > You

Re: Cascading Select Boxes in Admin?

2009-04-04 Thread Alex Gaynor
On Sat, Apr 4, 2009 at 3:47 PM, JGAllen23 wrote: > > Is there any way to have cascading select boxes in the admin app? The > second select box depends on what was chosen in the first. > > > There's no automated way to do this, you'd need to write some of your own ja

Re: Custom validation in view?

2009-04-04 Thread Alex Gaynor
? Can i > validate thee data in the view and manually set the form field errors? > > Paddy > > > > Take a look at number 2 here: http://collingrady.wordpress.com/2008/07/24/useful-form-tricks-in-django/ basically you'll just store user on your form object and then you can

Re: Easy way to create pretty pages with nav?

2009-04-05 Thread Alex Gaynor
tools and > > some undisclosed black magic? > > > > AEP has two sample blogs but truthfully they look pretty primitive. > > > > What am I missing? > > > Yes, you can absolutely create a views.py that isn't in a application, views are just python funct

Re: python version

2009-04-05 Thread Alex Gaynor
Traceback (most recent call last): > File "manage.py", line 2, in >from django.core.management import execute_manager > ImportError: No module named django.core.management > > How can I find the right python version to call? Maybe I can take it > from PYTHONPATH? If yes, where c

Re: cx_Oracle django and "dumb" connect

2009-04-05 Thread Alex Gaynor
; > File "I:\Python26\lib\site-packages\django\utils\encoding.py", line > 70, in force_unicode >raise DjangoUnicodeDecodeError(s, *e.args) > > DjangoUnicodeDecodeError: 'utf8' codec can't decode bytes in position > 11-12: invalid data. You passed in Datab

Re: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
n your URLconf. You need to make sure you have the URLs from both parts in your URLconf. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~--

Re: More beginner questions : model data in public view

2009-04-05 Thread Alex Gaynor
el and > perhaps im phrasing the question both wrong here and in my searches, > because i have not been able to find answer in groups or web. > > Alan > > > Your issue here is `lpl` is a QuerySet, not a lang object, when you want more than one object you use .filter and then iterate

Re: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
do is combine these into one urlpattern: from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^polls/$', 'mysite.polls.views.index'), (r'^polls/(?P\d+)/$', 'mysite.polls.view

Re: More beginner questions : model data in public view

2009-04-05 Thread Alex Gaynor
On Sun, Apr 5, 2009 at 3:30 PM, zayatzz wrote: > > Okay.. the problem was what i suspected, but i thought, that if i > filter the results and get object by its id, then it would be ok, > since im getting single object. > > Alan. > > On Apr 5, 10:25 pm, Alex Gaynor wrote:

Re: Beginner's Help needed

2009-04-05 Thread Alex Gaynor
ocumentation: http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ http://docs.djangoproject.com/en/dev/howto/deployment/modwsgi/ Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people&#x

Re: Best JS Library compatibility for Django

2009-04-05 Thread Alex Gaynor
ing said I personally like jQuery because of its simple API. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You re

Re: Validate with PIL

2009-04-05 Thread Alex Gaynor
if so you're installation wasn't successful. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You r

Re: need a multiselect list box for a static list of options

2009-04-06 Thread Alex Gaynor
27;, '__path__', > > > 'models'] > > > > > ??? > > > > That's the result I get if my PYTHONPATH is pointing to a 0.96.x version > of > > Django. > > > > Karen > > > There is no Django .97, presumably you mean some S

Re: Default items in a template

2009-04-06 Thread Alex Gaynor
g the other context_processors - since I would not have hit it > otherwise. > > > > It's probably easier for you to just write a custom inclusion tag that renders the nav. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it."

Re: textarea in ModelForm

2009-04-06 Thread Alex Gaynor
27;module' object has no attribute 'Textarea' > > I have tried a few variations but with no luck, > > Any ideas ? > > Thanks in advance > > > Those are par tof the Django forms library, not the models library, so it should look like: from django import forms

Re: textarea in ModelForm

2009-04-06 Thread Alex Gaynor
>enquiry_date = models.DateTimeField(auto_now_add=True) >replied = models.BooleanField(default=False) >def __unicode__(self): >return self.name > > class ContactForm(ModelForm): >class Meta: >model = ContactEnquiry >exclude = ('r

Re: Running django on a web hosting account

2009-04-06 Thread Alex Gaynor
gt; On Apr 6, 7:04 pm, atik wrote: > > Is there any free hosting site that provide django support? > > > http://djangofriendly.com/hosts/ has reviews for most hosts on Django support. I doubt very much you will find any free Django hosts. Alex -- "I disapprove of what you s

Re: Looking for a django job

2009-04-06 Thread Alex Gaynor
believe in God the chances are your God is too small. > > Read my blog: http://joshuajava.wordpress.com/ > Follow me on twitter: http://twitter.com/jpartogi > > > > There is no other central board that I'm aware of. However anyplace that lists job postings could have a D

Re: Multiple Primary Key

2009-04-07 Thread Alex Gaynor
On Tue, Apr 7, 2009 at 11:53 AM, sandravigo wrote: > > Hello, I want to know how I can to declarate multiple primary key in > my model > > > Django doens't support multiple column primary keys. This is the subject of ticket #373 in Django's trac. Alex -- "I

Re: Stuck in Tutorial Part 2: can't find django/contrib/admin/templates

2009-04-07 Thread Alex Gaynor
; > What are they talking about? > > > > It's relative to wherever you installed Django itself. If you aren't sure where django is intalled on your system(perhaps a package manager installed it) you can do import django; django.__file__ which shows the __init__ file in the dj

Re: Best Practices - Model Changes on Production servers

2009-04-07 Thread Alex Gaynor
27;. My biggest need right now is to get > an ALTER TABLE generator. > > Please let me know if one exists. > > Thanks, > Adam > > > There are several projects for schema evolution, the 2 most popular are Django-evolution and South. Alex -- "I disapprove of what you say,

Re: Something is eating memory. How to track it down?

2009-04-07 Thread Alex Gaynor
g(obj) > > ... and my RAM usage was below 30 MB at all time. > You also executed 350k SQL queries. A better idea would be to start with: for obj in Model.objects.all().iterator(): do_something(obj) > > > Maybe it's getting late and I deserve a nice gin and tonic... >

Re: Admin action not executed when no objects are selected

2009-04-07 Thread Alex Gaynor
ddocs#object-toolsexplains how to get them there(the part of the page that warns this is no longer applicable, isn't applicable for this). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the hi

Re: how does django registry work?

2009-04-07 Thread Alex Gaynor
question so we can give you better advice. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~-~--~~~---~--~~ You received this messa

Re: Problem setting up Admin site per chapter 6

2009-04-08 Thread Alex Gaynor
ning on Linux Fedora 10 X84_64. Please help. Thanks... > > > > Those refer to the 1.1(dev version now) and beyond way of hooking up admin urls. Consult the Django 1.0 docs for how to hook up the urls(everything else is the same). Alex -- "I disapprove of what you say, but I will d

Re: form error_messages doesnt work

2009-04-09 Thread Alex Gaynor
ts of erroneous tickets are filed), as SmilyChris notes it really just needs a docs fix, because the only other alternative is a bunch of try except blocks which is both unreasonable, and as Malcolm has stated really indicates that you should be using a different field type.

Re: Flup question

2009-04-09 Thread Alex Koshelev
Flup is just a proxy library between your Django project and web-server. It is communicating with web-server through FastCGI protocol. So you cannot just start FastCGI daemon and visit you project with browser. To work properly you must set up your web-server's FastCGI capabilities and direct it t

Re: Where is dictfetchall ?

2009-04-10 Thread Alex Gaynor
t; > Yes, of course I can write it. But isn't a framework supposed to > relieve us from such a boilerplate code? > Especially that it was in the framework already. Strange... > > Regards > MS > > > > Take a look at the values() method on a queryset: http://docs.d

Re: Different admin registry behavior with mod_python versus dev server

2009-04-10 Thread Alex Gaynor
tion differently under mod_python? > > The apache2 error_log only had something about "server reached > MaxClients setting, consider raising the MaxClients setting." > > > > > Where exactly do you have this code? The issue is that this code might be getting excecuted

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
rySet with results from multiple models. What you want to do is best approximated like this: from itertools import chain sorted(chain(Model1.obejcts.all(), Model2.objects.all()), key=lambda o: o.pub_date) Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Fri, 2009-04-10 at 16:44 -0400, Alex Gaynor wrote: > > > > > > On Fri, Apr 10, 2009 at 4:40 PM, veearrsix > > wrote: > > > > This question

Re: single queryset from multiple tables

2009-04-10 Thread Alex Gaynor
On Fri, Apr 10, 2009 at 7:52 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Fri, 2009-04-10 at 19:44 -0400, Alex Gaynor wrote: > > > > > > On Fri, Apr 10, 2009 at 7:40 PM, Malcolm Tredinnick > > wrote: > [...] > > > >

Re: SQL Between query in sqlite3

2009-04-10 Thread Alex Gaynor
27;2009-01-01' > ).filter(mydate__lte='2009-01-31') > -- > regards > kg > http://lawgon.livejournal.com > > > > You can also do mydate__range=(datetime_obj1, datetime_obj2). Alex -- "I disapprove of what you say, but I will defen

Re: Default mimetype

2009-04-11 Thread Alex Koshelev
There is no such capabilities. Write your own set of decorators that will be path response object with needed mimetype - almost DRY solution. On Sat, Apr 11, 2009 at 10:40 AM, Roman Timushev wrote: > > Hello, > > My application serves content with different mimetypes: 'application/ > xhtml+xml'

Re: Tutorial - include question

2009-04-11 Thread Alex Gaynor
return get_resolver(urlconf).resolve(path) > > File "/var/lib/python-support/python2.6/django/core/urlresolvers.py", > line 179, in resolve > for pattern in self.urlconf_module.urlpatterns: > > AttributeError: 'module' object has no attribute 'urlpattern

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
ce in those cases. > > Regards, > Malcolm > > > > > Even if your application is exclusively for your own usage, it's not uncommon for the pointy haired boss to come in with requests to change a URL hierarchy, and there's no reason to create more work for yourself. A

Re: every time that I load a form page, i have to reload the page to make errors go away

2009-04-11 Thread Alex Gaynor
On Sat, Apr 11, 2009 at 7:24 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sat, 2009-04-11 at 19:23 -0400, Alex Gaynor wrote: > [...] > > > > > > Even if your application is exclusively for your own usage, it's not > > uncommo

Re: UnpickleableError when sessions are saved

2009-04-11 Thread Alex Gaynor
> As the error message indicates(sort of), the only things that can be put in request.session are things that can be pickled, most things in Django itself can be(things like Querysets). When you have your own objects(or other 3rd party libs) you'll have to make sure those objs can be pickl

Re: How to find the version of Django?

2009-04-11 Thread Alex Gaynor
On Sun, Apr 12, 2009 at 2:38 AM, ydjango wrote: > > How do I find which version of django I have on my server? > > > import django; print django.VERSION That should have a tuple with the version info. Alex -- "I disapprove of what you say, but I will defend to the death

Re: Mulitple Time Zone support?

2009-04-12 Thread Alex Gaynor
lse Django has a easy solution > to it. > > > Take a look at django-timezones: http://code.google.com/p/django-timezones/which uses the pytz module for this. Alex -- "I disapprove of what you say, but I will defend to the death your right to

<    4   5   6   7   8   9   10   11   12   13   >