Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread Alex Gaynor
trying to do, in that example self.lastname is just a normal python string, so you can do "Smith" in self.lastname, for different datatypes it works slightly differently. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
gt; > > > As I said above, a checkout of the django source includes all the docs, which can be built into nice HTML just as online with the sphinx module for python. It takes all of 30 seconds. Alex -- "I disapprove of what you say, but I will defend

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Alex Gaynor
ntributed app that I can't modify. > > Thanks, > Kevin > > > http://docs.djangoproject.com/en/dev/ref/models/instances/?from=olddocs#get-foo-display Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people&

Re: Stupid Newbie ManyToManyField Contains question

2009-02-10 Thread Alex Gaynor
27;m an idiot, I read lastname in the wrong place, what you'll want to do for a manytomany is something like if self.lastname.filter(lastname__contains="Smith")[:1]: Alex -- "I disapprove of what you say, but I will defend to the death your r

Re: comparisons with java framework

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 4:52 PM, Greg Ewing wrote: > > Alex Gaynor wrote: > > > As I said above, a checkout of the django source includes all the docs, > > which can be built into nice HTML just as online with the sphinx module > > for python. It takes all of 30 second

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Alex Gaynor
On Tue, Feb 10, 2009 at 6:39 PM, Kevin Audleman wrote: > > Thanks Alex, however this is a solution at the View level, and I'm > using a view that I didn't write. Is there also a way to do this at > the template level? > > Thanks again, > Kevin > > On Feb 10

Re: Associating content with multiple sites

2009-02-11 Thread Alex Gaynor
h app. if it should > be in both sites then how may i proceed ahead? > If i keep events class in both models.py then i will face this problem > No, that would mean for app a and b you will get tables: a_eventtype > and b_eventtype. > > > Take a look at the sites framework: http://d

Re: A ManyToMany Field question.

2009-02-11 Thread Alex Gaynor
get_all_groups(user): >return all_groups > > >>>get_all-groups(U1) > [G1, G2] > > that all. > > Thank. > > > > > On Tue, Feb 10, 2009 at 12:18 PM, khsing wrote: > > Alex, thanks, now it work. > > > > now have a new problem is m

Re: Tutorial part 3 q'n

2009-02-11 Thread Alex Gaynor
rlpatterns = patterns('polls.views', ... to decouple the > app completely. > > > > This has been suggested many many times(check Trac), it's general consensus is that while that's the correct way to do it in general, if the user doesn't have their pythonpath setup cor

Re: executing raw sql results in traceback

2009-02-11 Thread Alex Gaynor
order by date_received desc" > > > %s is not used in this statement. > > > I believe that you need to escape the % by doing %%. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's goo

Re: comparisons with java framework

2009-02-11 Thread Alex Gaynor
bout the abilities and > > needs of your users. > > > > Regards, > > Andrew Ingram > > > > > > > > > > > This is another case of generating work for someone as far as I can tell, sphinx autogenerates the make file for us, we didn't w

Re: Stuck on how to create a Python daemon using django

2009-02-11 Thread Alex Gaynor
ite a custom management command that runs as a daemon, see http://www.oebfare.com/blog/2008/nov/03/writing-custom-management-command/for an idea of how to do ths. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people

Re: order_by Ignore case

2009-02-11 Thread Alex Koshelev
You can do the same trick with django: Entry.objects.extra(select={'foo_upper': 'upper(foo)'}, order_by=['foo_upper']) On Wed, Feb 11, 2009 at 7:20 PM, jeffhg58 wrote: > > I currently have a field which has upper and lower case characters. Is > there a way for the django api to ignore case usi

Re: Admin Change List Page - Can I have anonymous users view this table?

2009-02-11 Thread Alex Gaynor
building a page like that for your specific data isn't terrible hard and there are a few cool projects like django-tables or django-filter(disclaimer, I wrote this) to help you in building such a page. Alex -- "I disapprove of what you say, but I will defend to the death your right to

Re: DateField with Django

2009-02-11 Thread Alex Gaynor
Atenciosamente, > Edgard Matos > E-mail: edgardma...@gmail.com > Skype: edgardmatos > Celular: 85 8837 8285 > > > > > Please be more patient, you've scarcely waited 3 hours before sending another email. Remember that everyone who replies here is a volunteer, and we are

Re: Django installation on Linux

2009-02-11 Thread Alex Gaynor
r = os.path.dirname(__file__) > NameError: name '__file__' is not defined > > How should I fix this? I thought maybe to modify the 'os.path.dirname > (__file__)' line and to specify the > abs path for the root_dir (does the roor_dir mean the Django > dire

Re: Strange url tag behaviour

2009-02-11 Thread Alex Koshelev
Leave it empty FORCE_SCRIPT_NAME ='' On Wed, Feb 11, 2009 at 8:36 PM, Leslie Maclachlan wrote: > Thanks Dmitry, > > I entered it as: FORCE_SCRIPT_NAME = '/var/opt/django/projects/ilayer' this > has not resolved it - did I put it in the correct format? > > Regards, > Leslie > > Dmitry Dzhus wro

django-registration & django-profile together

2009-02-11 Thread Alex Rades
Hi, I'm developing a site using django-registration and I'm pretty happy with it. Now, I need to attach a profile to each user, with some additional information. I've set up django-profiles and... works OK too :) What I'd like to do now is to "force" a new user to fill his profile. Is there any f

Re: django-registration & django-profile together

2009-02-11 Thread Alex Rades
It's "django-profiles" not "django-profile" On Wed, Feb 11, 2009 at 10:15 PM, Alex Rades wrote: > Hi, > I'm developing a site using django-registration and I'm pretty happy > with it. Now, I need to attach a profile to each user, with some > addi

Re: Context processor or make custom tag

2009-02-11 Thread Alex Gaynor
ut my english. > > > > I would do a template tag, for me the distinction is a context processor is for getting just a single variable, such as MEDIA_ROOT or whatever, whereas a templatetag is for getting some data and doing some processing. I guess it's a bit of a thin line for

Re: django-registration & django-profile together

2009-02-11 Thread Alex Rades
On Wed, Feb 11, 2009 at 10:43 PM, Mike Ramirez wrote: > I don't know about django-profiles, but django-registration provides a couple > signals, user_registered and user_activated. By connecting a handler to > either one of these singals you can redirect the users to the profile form > page. > >

Re: Documentation for Download?

2009-02-11 Thread Alex Gaynor
nks > Tim > > > > Every django tarball or svn checkout includes a docs/ dir that has the full docs, you can build these into HTML, latex, pdf whatever using Sphinx. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire

Re: Custom widget for images is deleting them

2009-02-11 Thread Alex Gaynor
27;)=='on': >obj.pic1='' > > And this goes back to the behaviour in the original step. > > I have tried putting in various breaks in the django code in files.py > to try and understand what is happening but my lack of debugging > skills are

Re: Documentation for Download?

2009-02-11 Thread Alex Gaynor
On Wed, Feb 11, 2009 at 6:59 PM, Tim Johnson wrote: > > On Wednesday 11 February 2009, Alex Gaynor wrote: > > > Every django tarball or svn checkout includes a docs/ dir that has the > full > > docs, you can build these into HTML, latex, pdf whatever using Sphinx. >

Re: Custom widget for images is deleting them

2009-02-11 Thread Alex Gaynor
the job: > > ... > A9765/examples/hello/urls.py > A9765/examples/views.py > A9765/examples/__init__.py > A9765/examples/settings.py > A9765/examples/urls.py > A9765/setup.cfg > U 9765 > Checked out revision 9824. > > And dates are Feb 2 &

Re: A ManyToMany Field question.

2009-02-11 Thread Alex Gaynor
On Wed, Feb 11, 2009 at 9:06 PM, khsing wrote: > > Alex, thank you very much. > > I find if g1 belong g2, g2 will belong g1 automatically, but that is not > right. > > should I rewrite models like this one? > > groups = models.ManyToManyField('self', symmetri

Re: A ManyToMany Field question.

2009-02-11 Thread Alex Gaynor
t; > Thanks. > > > > On Thu, Feb 12, 2009 at 10:08 AM, Alex Gaynor > wrote: > > > > > > On Wed, Feb 11, 2009 at 9:06 PM, khsing wrote: > >> > >> Alex, thank you very much. > >> > >> I find if g1 belong g2, g

Re: Django installation on Linux

2009-02-11 Thread Alex Gaynor
On Wed, Feb 11, 2009 at 10:26 PM, rg wrote: > > 2.2.3. > > > On Feb 11, 12:21 pm, Alex Gaynor wrote: > > On Wed, Feb 11, 2009 at 12:20 PM, rg wrote: > > > > > So I'm trying to install Django on a Linux server (I don't have root > > >

Re: Documentation for Download?

2009-02-11 Thread Alex Gaynor
> There was a fairly long thread about this just yesterday, I suggest searching this mailing list for it. 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: File Uploading

2009-02-12 Thread Alex Gaynor
me, size, and data > (either in chunks or in one piece). There's an example handle_uploaded_file > function that iterates through the data chunks and does something with > them. Obviously it's not going to do exactly what you want to do with your > file data, but that page lays o

Re: need help limiting choices on admin form for ForeignKey field

2009-02-12 Thread Alex Gaynor
key hook only exissts in trunk, not in 1.0.2, so if you're on 1.0.2 you'll need to overide the formfield_for_dbfield method, which is a little more general. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people&#x

Re: need help limiting choices on admin form for ForeignKey field

2009-02-12 Thread Alex Gaynor
On Thu, Feb 12, 2009 at 3:12 PM, Michael Repucci wrote: > > Oh. It doesn't mention that in the documentation. I am using 1.0.2- > final. I'll check out formfield_for_dbfield. Thanks for the pointer! > > On Feb 12, 3:09 pm, Alex Gaynor wrote: > > On Thu, Feb 12, 2

Re: need help limiting choices on admin form for ForeignKey field

2009-02-12 Thread Alex Gaynor
ny > other thoughts? > > On Feb 12, 3:12 pm, Michael Repucci wrote: > > Oh. It doesn't mention that in the documentation. I am using 1.0.2- > > final. I'll check out formfield_for_dbfield. Thanks for the pointer! > > > > On Feb 12, 3:09 pm, Alex Gaynor w

Re: need help limiting choices on admin form for ForeignKey field

2009-02-12 Thread Alex Gaynor
On Thu, Feb 12, 2009 at 3:49 PM, Michael Repucci wrote: > > Oh, bummer. Is there a *not so good* way to do it in 1.0.2? It'd be > nice to do it at all. > > Or is it perhaps not as scary as I think (as a newbie) to use the > latest development version? > > On Feb 12

Re: admin/doc/ The requested admin page does not exist.

2009-02-12 Thread Alex Gaynor
n page does not > exist.". > > When I visit a bogus URL the error page confirms taht ^admin/doc/ is > in the URL patterns, and > import django.contrib.admindocs.urls works, so the app is installed. > > > Is admin/doc in your urlconf after the rest of the admin urls? Alex

Re: admin media deployment

2009-02-12 Thread Alex Gaynor
w/o such a link. > > Another developer I spoke with fixed the same problem this way. > Neither of us has seen documentation of such a deployment requirement. > Is there a better way? Did we miss some documentation? > > > > Yes, you did :) . http://docs.djangoproject.com/en/de

Re: Admin site I18n - ForeignKeys, app names questions

2009-02-12 Thread Alex Gaynor
hen I first started using > it, so those are just my unofficial instructions derived through > trial&error). > > > > I don't think strings marked as fuzzy are actually used for translations, they are just kept around as references for the translators benefit. Alex -- "I

Re: Javascript problem

2009-02-12 Thread Alex Gaynor
ngs and it did not work! I read many things, but I > can't figure out how to solve this pb. > Is there an easy solution? > > Thx a lot for your help > Arbi (newb) > > > Take a look here: http://docs.djangoproject.com/en/dev/howto/static-files/?from=olddocs Alex -- &qu

Re: using models interfaces as a communication layer (not to db directly)

2009-02-12 Thread Alex Gaynor
sure I follow, are you wanting the Django models to produce XML or to use XML as a backend(in place of a relational DB). The former is exceptionally easy, the latter requires quite a bit of custom code if you want to use the Django ORM. Alex -- "I disapprove of what you say, but I

Re: using models interfaces as a communication layer (not to db directly)

2009-02-12 Thread Alex Gaynor
On Fri, Feb 13, 2009 at 12:49 AM, matt pokrzywa wrote: > > Hi Alex, > > Thanks for the quick response. I think what I really want is the > latter, using XML as a backend using Django ORM. Is it feasible to > do? > > Thanks, > > Matt > > On Feb 13, 12:34 am,

Re: Problem looping queryset in template

2009-02-13 Thread Alex Gaynor
On Fri, Feb 13, 2009 at 2:13 PM, Mike Ramirez wrote: > This is the traceback for the error. > > http://dpaste.com/120271/ > > This error happens whenever I return a List of QuerySets on this page with > more than one item. With one item, it works as expected. > > The code is here: > > http://dpa

Re: Admin site I18n - ForeignKeys, app names questions

2009-02-13 Thread Alex Gaynor
by providing a verbose_name argument. 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 message

Re: Advice on many to many with too many records in admin

2009-02-14 Thread Alex Gaynor
ommon web pattern. Cons: I'd say quite a bit more time > consuming to set up. > > Any other ways to do this? Or some examples of #2 to help someone > along? > > Thanks, > Rob > > > Have you tried using raw_id_fields with it? http://docs.djangoproject.com/en/dev/ref/con

Re: Advice on many to many with too many records in admin

2009-02-14 Thread Alex Gaynor
On Sat, Feb 14, 2009 at 2:44 PM, Rob Hudson wrote: > > On Sat, Feb 14, 2009 at 11:29 AM, Alex Gaynor > wrote: > > Have you tried using raw_id_fields with it? > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#raw-id-fields > > Just now tested that out. Tha

Re: Django database connections

2009-02-14 Thread Alex Gaynor
taneous requests in the same thread. There is a signal handler that closes this connection to the DB at the end of each request. There is no connection pool, when a new connection is opened it is really created to the db, and when it's closed it really is closed. Alex -- "I di

Re: date-based ordering confusion

2009-02-14 Thread Alex Gaynor
el itself, since it ends up > in any QuerySet involving that model. > > Hope that helps, > Justin > > > Justin, I'd take a look at that link again: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#ordering Alex -- "I

Re: get_absolute_url always returning empty string

2009-02-15 Thread Alex Koshelev
Why do you wrap two times the same `get_absolute_url` with `models.permalink` decorator? On Sun, Feb 15, 2009 at 10:42 AM, Michael Strickland wrote: > > Completely lost on this... I'm trying to set up permalinks to my > articles, which are using generic views. I've gotten it to work by > hard co

Re: Charts for Admin Interface

2009-02-15 Thread Alex Gaynor
gt; don't know how I can add things like Charts or PDFs, ... > > I hope anybody can give me a help in this case! > > > > Nice regards > > Robert > > > > > > > > > Just a note, the docs you're refering to about adding urls are for the trun

Re: Dynamically traversing a list in templates

2009-02-15 Thread Alex Gaynor
On Sun, Feb 15, 2009 at 2:47 PM, nivhab wrote: > > Does anyone know of a way to traverse a list in templates in a dynamic > way? > Let's say I have the following list: > {'message': [u'This field is required.'], 'sender': [u'Enter a valid e- > mail address.']} > > and I do not know in advance the

Re: Dynamically traversing a list in templates

2009-02-15 Thread Alex Gaynor
ion. So it seems there is no way of doing such and iteration in > this version. Only 1.0 or DEV versions. > > On Feb 15, 9:57 pm, Alex Gaynor wrote: > > On Sun, Feb 15, 2009 at 2:47 PM, nivhab wrote: > > > > > Does anyone know of a way to traverse a list in temp

Re: how to automatically call an additional function on saving a model?

2009-02-15 Thread Alex Gaynor
matically call a function for every RequestItem object each > time I'm saving a RequestAdmin form. This > function is defined in RequestItem's model. > > Any suggestions? > > Regards, > Gábor > > > > I'm not 100% I follow, but you're looking for

Re: Dynamically traversing a list in templates

2009-02-15 Thread Alex Gaynor
On Sun, Feb 15, 2009 at 6:02 PM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Sun, 2009-02-15 at 15:09 -0500, Alex Gaynor wrote: > > > > > > On Sun, Feb 15, 2009 at 3:07 PM, nivhab wrote: > > > > Thanks for the fast reply! >

Re: Table Inheritance and save() method

2009-02-15 Thread Alex Gaynor
the trade-off being that if you modify the related > > model, you'll be responsible for explicitly saving it). > > > > Regards, > > Malcolm > > > select_related doesn't traverse the reverse relation from inheritance either, there's a ticket about this: htt

Re: InnoDB tables for MySQL

2009-02-15 Thread Alex Gaynor
use functional constraints on > foreign keys one must use InnoDB tables in MySQL. > > Is there someway to change the table type created from MyISAM to > MyInnoDB with MySQL? > > > By adding: DATABASE_OPTIONS = { "init_command": "SET storage_engine=INNODB",

Re: Automated Translation Management -- Surely someone has already done this?

2009-02-15 Thread Alex Gaynor
re? But I cannot find it > anywhere online. Isn't there a django-translation-management package > already written? Or should I create it once I finish coding? How have > other people streamlined this process? > > > You really want to be storing the translations at the DB

Re: Keys composed of multiple fields

2009-02-16 Thread Alex Koshelev
Django doesn't suppurt multi-field PKs. Try to search this group for more diussion. On Mon, Feb 16, 2009 at 12:43 PM, jfmxl wrote: > > Hi again, > > How do I handle multifield keys? > > I have multifield primary keys which are in turn used as foreign keys > in other tables. > > My database backe

Re: LaTeX custom Field, png url

2009-02-16 Thread Alex Gaynor
ds in the DB, with one psuedofield similar to the generic foreign key that actually handles combining those 2 into a real item. 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."

Re: LaTeX custom Field, png url

2009-02-16 Thread Alex Gaynor
e used the user defines 2 fields on the model, and then the generic foreign key acts as a psuedofield(it exists in python, but not the DB) and combines the data from both those fields. That's how I would do it, take a look at django.contrib.cotnenttypes.generic to see how that's imple

Re: order_by foreign key

2009-02-16 Thread Alex Gaynor
models.BooleanField( default=True) >ActiveFlag = models.BooleanField( default=True) > objects = models.Manager() # The default manager. > >config_objects = ResultManager() > > > class Status( mode

Re: BINARY columns

2009-02-16 Thread Alex Gaynor
eze all the core developers attention is really on these features, so I don't think any of them will have the time to look at that, as it's something that can live outside of Django I would suggset using it like that(or with the patch applied to your Django install) until hopefully a deve

Re: Question about class variables

2009-02-16 Thread Alex Gaynor
mation in request.user, is the > change to the class variable scoped only to that request? Or am I > doing something dangerous? > > > Nope, that change will be to the entire python process, so that's not how you want to handle it. Alex -- "I disapprove of what you say, but I

Re: cache.get_model() vs. models.get_model()

2009-02-16 Thread Alex Gaynor
ctly the same as you can see from the source: http://code.djangoproject.com/browser/django/trunk/django/db/models/loading.py#L178 access without the .cache. exists solely for backwards compatibility. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
>list_display = ('username', 'email', 'first_name', 'last_name', > 'is_staff') >list_filter = ('is_staff', 'is_superuser') >inlines = [ProfileInline] > > admin.site.register(User, UserAdmin) > >

Re: Settings for an application - define as a model?

2009-02-16 Thread Alex Gaynor
> Yours, > Russ Magee %-) > > > > I don't know how well Marty maintains it, but if it doesn't work out for you the satchmo guys have a nice fork of it that's obviously actively worked on, so you can always use it(with minimal other bits from stachmo) if it works be

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
kly > view a list of users with a payment_status of 'Unpaid.' Is there a way > to add a related field to the list_display or list_filter sets for the > User object? > > Cheers, > Kevin > > On Feb 16, 3:45 pm, Alex Gaynor wrote: > > On Mon, F

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Alex Gaynor
On Mon, Feb 16, 2009 at 7:13 PM, Kevin Audleman wrote: > > Alex, > > I feel like I'm one step closer to getting this to work. From the > documentation you sent my way, it seems like what I would do would be > to create a method on the User object which will span the rela

Re: Multiple Databases Revisited (Interim)

2009-02-17 Thread Alex Gaynor
es. You can find quite a few blog posts on this strategy. I'd also be remiss if I didn't note the fact that it's my intention to apply for the Google Summer of Code to work on multidb. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it

Re: reuse FilteredSelectMultiple

2009-02-17 Thread Alex Gaynor
7;SelectFileter is not defined' > javascript error. > > Any idea? > > > > Are you including the form's media when you render the form? You can do this by putting {{ form.media }} somewhere in the HEAD of the document.

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
nKeyRawIdWidget. > > How can I do it? Is there another way to accomplish this? > > Cheers! > -- > João Olavo Baião de Vasconcelos > Bacharel em Ciência da Computação > Analista de Sistemas - Infraestrutura > joaoolavo.wordpress.com > > > > I think value is a lis

Re: uploading files

2009-02-17 Thread Alex Gaynor
ded file with the name 'name.txt'. I would like > to save the uploaded file with the original file name. How could that be > accomplished? > > Thank you! > Tonu > > > > > Uploaded files have a name attribute that contains their name. Alex -- "I di

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 1:54 PM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > On Tue, Feb 17, 2009 at 11:47 AM, Alex Gaynor wrote: > >> I think value is a list in that case, of the primary keys, but the best >> way to find out is through expirementation,

Re: Making model methods available to templates

2009-02-17 Thread Alex Gaynor
le to a web template (ex: by calling something like > > {{ item.cost }} )? > > > > Thanks! > > > > wotaskd > > > What Tim said is completely correct, just as a side note, you can't do this with any methods that actually require arguments though(ot

Re: Show labels next to ManyToMany raw_id_fields

2009-02-17 Thread Alex Gaynor
On Tue, Feb 17, 2009 at 4:50 PM, João Olavo Baião de Vasconcelos < joaool...@gmail.com> wrote: > On Tue, Feb 17, 2009 at 5:15 PM, Alex Gaynor wrote: > >> Sure, what you're doing will be similar to the way it works for a foreign >> key, but you're dealing

Re: Customizing Admin to display non-editable fields

2009-02-17 Thread Alex Gaynor
od on widgets doesn't get the initial value, however you can do it: http://lazypython.blogspot.com/2008/12/building-read-only-field-in-django.html 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 highe

Re: Translation of type from urls to view

2009-02-17 Thread Alex Gaynor
gt; > I seems to recall that was the case, with older version of Django > (maybe I recall wrongly??). But not so with the trunk (9845). > > > > > Nope, it has never been(at least since I began using Django 1.5 years ago) that parameters were automatically cast to int. Alex -- &

Re: 1.0 branch?

2009-02-17 Thread Alex Gaynor
es/releases/1.0.X that is the work that becomes the various point releases(currently 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 the highest law."--Cicero --~--~-~--~~-

Re: django 0.97 and image thumbnails

2009-02-18 Thread Alex Gaynor
umbnail/ and if that doesn't work you may need to roll something yourself using PIL. 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: Getting Django to generate a report automatically on a assigned date?

2009-02-18 Thread Alex Gaynor
gt; You want to use a cron job, probably coupled with a management script to actually generate the report itself. 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."--Cicer

Re: Python Versions and manage.py

2009-02-18 Thread Alex Gaynor
lem > > Andrew > > > I'm not super familiar with how windows handles it's path, but if you do ./manage.py on unix it will use your default python installed, however you can also do python manage.py or python2.5 manage.py or python2.6 manage.py to specify which version to

Re: Query that grabs objects before and after object

2009-02-18 Thread Alex Gaynor
nt to order by and do something like: Model.objects.filter(field__gt=obj.field).order_by('field')[:4] to get the 4 greater than it and Model.objects.filter(field__lt=obj.field).order_by('-field')[:4] to get the 4 less than it. Hope this helps, Alex -- "I disapprove of what

Re: Registration Behavior

2009-02-18 Thread Alex Gaynor
gt; > > Any pointers would be greatly appreciated. > > > > Cheers, > > > > Tim > > > There is a setting in django which controls where you are redirected to after logging in: http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#login-redirect-u

Re: Modifying pythonpath in settings.py

2009-02-18 Thread Alex Gaynor
namically modify the pythonpath in > > something like settings.py? > > > > -- dz > > > > > > There is no 1 generic way to handle it but IME the following 3 will handle any application: 1) in manage.py for runserver(probably not an issue since it's using your u

Re: Readonly Field

2009-02-19 Thread Alex Gaynor
on.blogspot.com/2008/12/building-read-only-field-in-django.html 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: New password does not authenticate

2009-02-19 Thread Alex Gaynor
t authenticate() fails. > > Thanks for any help. > > Jeff > > > > You aren't actually calling the save method on user. save is a method so you need to call it: user.save(). Alex -- "I disapprove of what you say, but I will defend to the death your right to sa

Re: form media and duplicating javascript links

2009-02-19 Thread Alex Gaynor
On Thu, Feb 19, 2009 at 2:00 PM, christian.oud...@gmail.com < christian.oud...@gmail.com> wrote: > > I have alot of pages using javascript, and a lot of forms that specify > javascript in the Meta.media class. I keep having problems duplicating > javascript includes. This happens when i include th

Re: unicode/str not callable

2009-02-19 Thread Alex Gaynor
t.POST['search'], number)}.get(engine) > except KeyError: > tips=google(request.POST['search'], number) > > > Thanks, > Nicolas > > > > > Remember when you do that it's going to call every single one of those functions re

Re: Template rendering error

2009-02-20 Thread Alex Koshelev
Do you read an attribute resolution rules [1]? [1]: http://docs.djangoproject.com/en/dev/topics/templates/#variables On Fri, Feb 20, 2009 at 5:53 PM, Timothy <83...@gmx.de> wrote: > > Hi Folks, > > in views: > > return render_to_response('tliste/import.html', {'data': > allWrongData}) > > allWr

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
Try this: del SubForm.fields['fields2'] On Fri, Feb 20, 2009 at 6:15 PM, David Zhou wrote: > > Suppose I had this form: > > class BaseForm(forms.Form): >field1 = forms.CharField(...) >field2 = forms.Charfield(...) > > And then in a subclass, I had: > > class SubForm(BaseForm): >fie

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
No. Place this code right after the SubForm definition. On Fri, Feb 20, 2009 at 6:42 PM, David Zhou wrote: > > Do you mean del self.fields['field2'] in SubForm's __init__? > > -- dz > > > > On Fri, Feb 20, 2009 at 10:39 AM, Alex Koshelev > wrote

Re: Removing fields in a form subclass

2009-02-20 Thread Alex Koshelev
Oh, sorry. Of course `base_field` instead. class SubForm(BaseForm): field1 = forms.EmailField(...) del SubForm.base_fields['fields2'] On Fri, Feb 20, 2009 at 6:45 PM, Alex Koshelev wrote: > No. Place this code right after the SubForm definition. > > > On Fri, F

Re: django newbie question

2009-02-20 Thread Alex Gaynor
; : > "Company.county" must be a "County" instance. > > doesn't this create the instance? > >> c=County('blah blah', slug='blah-blah') > > > Any suggestion or point out my error would be appreciated. > > > > > &g

Re: django newbie question

2009-02-20 Thread Alex Gaynor
d type this: > > > > > >>c=County(name='blah blah, slug="blah-blah") > > > > > then > > > > > >> l = Company(name='xyz corp', address='56 b. street', client='G > corp', city = 'Walla Walla', coun

Re: distinct values in list

2009-02-20 Thread Alex Gaynor
print one value from the items you can do something like: Model.objects.values_list('field', flat=True).distinct() that will return a list of all the values in that field, but distint of course. Alex -- "I disapprove of what you say, but I will defend to the death your right

Re: distinct values in list

2009-02-20 Thread Alex Gaynor
On Fri, Feb 20, 2009 at 7:58 PM, nixon66 wrote: > > tried > > Place.objects.values_list('county', flat=true).distinct() > > Now its not returning any values. > > On Feb 20, 7:49 pm, Alex Gaynor wrote: > > On Fri, Feb 20, 2009 at 7:46 PM, nixon66 wrote: &

Re: django spreadsheet

2009-02-21 Thread Alex Gaynor
generate excel or csv spreadsheets. If it's the latter I'd reccomend going over to django snippets as there are several relevant snippets. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "

Re: Using Admin Datepicker in Other Apps

2009-02-21 Thread Alex Gaynor
On Sat, Feb 21, 2009 at 7:48 AM, Chris wrote: > > Is it a good idea to reuse admin's JS datepicker widget in other apps, > and if so, what's the best way? > > I'm using django.contrib.admin.widgets.AdminDateWidget in my form, and > I've added these JS tags to my template: > > admin/DateTimeShortc

Re: Use model of non-installed app

2009-02-21 Thread Alex Gaynor
arent class's table doesn't exist your subclass's table can't have a relation to it, therefore it breaks down. 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.&

Re: Can QuerySet methods combine filters with an "OR" conjunction?

2009-02-21 Thread Alex Koshelev
You have to use `Q` objects [1] [1]: http://docs.djangoproject.com/en/dev/topics/db/queries/#complex-lookups-with-q-objects On Sat, Feb 21, 2009 at 9:40 PM, Nate Morse wrote: > > Before I go down the road of writing SQL by hand or using > QuerySet.extra(...) [ don't know much about that yet:],

Re: Call for horrible (or nice) models.py files

2009-02-21 Thread Alex Gaynor
7;t want secrets, > just files you're happy to let me see. These files won't go anywhere > other than my own PC anyway; any failures will be made into their own > unit tests. > > So, that's the call. Anyone up for it? > > Andrew > > > > I'm in

Re: Call for horrible (or nice) models.py files

2009-02-21 Thread Alex Gaynor
nd > migrations are often edited by them and b) not always available (due to > the inherent security flaws it has). > > Hope that makes it somewhat clear... > > Andrew > > > Alex Gaynor wrote: > > > > I'm interested in your need to parse the file directly,

<    1   2   3   4   5   6   7   8   9   10   >