Re: Django Resource Usage

2009-03-06 Thread Alex Gaynor
Also consider a hosting mechanism not yet mentioned in the docs, mod_wsgi. Alex On 3/6/09, Graham Dumpleton wrote: > > > > On Mar 6, 10:45 pm, Paulo wrote: >> Well, this leads me to an unknown path. Where i can find more >> information about how to install it and

Re: Compressed fixtures?

2009-03-06 Thread Alex Gaynor
This only works on the latest development version of Django, not 1.0. -- "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 messag

Re: Upload picture -> AJAX Thumbnail -> Save in DB

2009-03-07 Thread Alex Gaynor
gt; process? > > Cheers > Ben > > > As best I recall you can't do a multipart form submission over Ajax, so you need something like an iFrame I think. Alex -- "I disapprove of what you say, but I will defend to the death y

Re: Use django.contrib.auth.login at root of site

2009-03-07 Thread Alex Gaynor
y logged in (that is without writing my > own view to handle the auth,login stuff ? > > > Write your own view, but basically have it do: def my_view(request): if request.user.is_authenticated(): do_my_stuff() else: return login(request) Alex -- "I disa

Re: Compressed fixtures?

2009-03-07 Thread Alex Gaynor
ren > > > > Karen is correct, if you are working with 1.0 itself I always reccomend you use Jannis Leidel's mirror of the 1.0 docs: http://docs.jezdez.com/ Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The pe

Re: Best practice for a site-wide form (ie: search)?

2009-03-07 Thread Alex Gaynor
late tag that was passed the variable and rendered that if there was data, else created and rendered a blank form. 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: Best practice for a site-wide form (ie: search)?

2009-03-07 Thread Alex Gaynor
te tag? > > Making sure I got it, that does sound better. > > Thanks. > > > > On Mar 7, 4:25 pm, Alex Gaynor wrote: > > On Sat, Mar 7, 2009 at 4:03 PM, luell.m...@gmail.com > > wrote: > > > > > > > > > > > > > > >

Re: Dynamically default second form field from droplist value of another field in the same form

2009-03-08 Thread Alex Gaynor
You need to write some javascript to do this, using ajax probably. The technique for solving this on the client is orthagonal to django. Alex On 3/8/09, ldm999 wrote: > > I'd like to have a Django form with 2 fields: List Type droplist (eg > Books, Movies) and List Name

Re: custom filter question

2009-03-08 Thread Alex Gaynor
I do as you stated > above, I get the error: > ImproperlyConfigured: ImportError ea_app: No module named ea_app > > Thanks for spending your time helping a newbie... > Dan > > > > Is the folder that contains the folder ea_app on your PYTHONPATH?

Re: continuously gathering feeds

2009-03-08 Thread Alex Gaynor
Just right a script to do this(possibly as a management command) and schedule it to run every X minutes. 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: [slightly OT] Web deployment certification

2009-03-08 Thread Alex Gaynor
cern would be I don't think it's a particularly good thing to mix concerns about design vs. development, they really draw on entirely seperate skills even if the tools are a little similar. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it."

Re: Creating a multi-column index

2009-03-08 Thread Alex Gaynor
something built-in > to django now? > > Thanks, > Matt > > > Django can't handle a multiple column primary key(see ticket #373) however it can handle a multiple column unique index: http://docs.djangoproject.com/en/dev/ref/models/options/#unique-together. Alex -- "I disa

Re: pip install error for pinax 0.7.0

2009-03-09 Thread Alex Gaynor
zip_file(filename, location, flatten=not filename.endswith > ('.pybundle')) > File "c:\python25\lib\site-packages\pip-0.3.1-py2.5.egg\pip.py", > line 1954, in unzip_file >fp = open(fn, 'wb') > IOError: [Errno 2] No such file or directory: 'c:\\use

Re: Needed: a tidy model for varying numbers of multiple numerical values (page number refs)?

2009-03-09 Thread Alex Gaynor
ee if these bounds fall within another > one). This has advantages that you can sort them, perform better > checks on them, querying against them is easier, you can > aggregate them to find the count, and you're not limited to an > arbitrary number like 30. Granted, many of these

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
validation you'll have to write some for whatever the data entry mechanism is, usually forms, either for your views or the admin. 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.&qu

Re: Django and SEO activities

2009-03-09 Thread Alex Gaynor
gt; > > > Thanks for your time. > > > Django makes a lot of the SEO best practices, such as sitemaps, very easy, in addition in empahsis clean urls, and a single resource per URL(by keeping the usage of the trailing / consistant), other than that there's not much it can do. The

Re: How to get the value of ForeignKey

2009-03-09 Thread Alex Gaynor
I need to retrieve 'name' field of 'BankerCategory' with 'Homeloan' > > > object > > >home=Homeloan.objects.all() > > > from this 'home' object how can i access value of 'name' field of > > >

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
t; I mean if I already have {"node_a": 1, "node_b": 2}, I can't add > {"node_a": 2, "node_b": 1} > How to enforce this restriction efficiently? > > > > Are you looking to maintain cross field uniqueness, if so: http://docs.djangoproject.com/

Re: Different Database object behavior on Production and Development servers.

2009-03-09 Thread Alex Gaynor
odel and postgres sql > server stuctures. > > Any clues why my development server fetches and filters will not > return coherent > data? > > > > > > > What you've pasted so far doesn't say anything about the data itself, all it indicates is your __unicode_

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
d > Edge(node_a=y, node_b=x).save() > because edge is a set of two distinct nodes. > > On Mar 9, 8:54 pm, Alex Gaynor wrote: > > On Mon, Mar 9, 2009 at 8:52 AM, uprising wrote: > > > > > Just reminded of a problem by this post, how can I validate a uniq

Re: forms.ModelForm

2009-03-09 Thread Alex Gaynor
r of people trying to make > > automatic model-related forms do all sorts of funky things, because I > > hardly ever use them. So many of my use-cases don't have forms mapping > > directly to models, so I write a normal Form class and then my view > > knows how to t

Re: forms.ModelForm

2009-03-09 Thread Alex Gaynor
in my ModelForm fields? > > > > > > On Mar 9, 10:51 am, mike171562 wrote: > > Thanks alex, that worked, I have the extra field, and now to figure > > out how to to tie it in to the main form and my user model. > > > > On Mar 9, 10:12 am, Alex Gaynor wrote

Re: radio button assignment as filter in search

2009-03-09 Thread Alex Gaynor
correct in the function. Any suggestions? > > > > > > You've omitted quite a bit of code from here which unfortunately makes this quite difficult to follow, because based on what you've shown us you should be getting quite a few NameErrors. Alex -- "I disappr

Re: a little help on creating a 'global' file

2009-03-09 Thread Alex Gaynor
.ocultarEstado', > ) > # -- > my question here: how can i import all functions inside 'globalValues' > file with one call?? -i'm looking for a "myproject.globalValues.*" > kind of expression"- making every function calling with an entry is > qui

Re: Get Current User

2009-03-09 Thread Alex Gaynor
project.com/en/dev/topics/auth/#authentication-in-web-requests > > -Rajesh D > > > > The important thing to remember is that you never have access to some global user object, you need to pass it to wherever needs it. Alex -- "I disapprove of what you say, b

Re: radio button assignment as filter in search

2009-03-09 Thread Alex Gaynor
e this helps someone else. > > > Yes, all items that come in over HTTP come in as strings, you need to process them yourself(or handle it using django.forms). Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire &qu

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
leads me to > wonder if Django is: > a) automagically appending my project directory to the pythonpath when > I run the ./manage.py shell > b) somehow stomping on my pythonpath configurations when I run the > devserver > > Anyone have any advice? > > > Yes, manage.py

Re: Not able to select from Oracle view

2009-03-09 Thread Alex Gaynor
ion, everything looks in order. > I'm using Django trunk, Python 2.6.1 and cx_Oracle-5.0.1 > > TIA, > Brandon > > > Nope, it should just work. What happens when you try to do the query, do you get an exception? ALex -- "I disapprove of what you say, but I will def

Re: Not able to select from Oracle view

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 3:06 PM, Brandon Taylor wrote: > > Hi Alex, thanks for the response. > > I see that Django is trying to select a property that doesn't exist > from this view... > > SELECT "LU_CSU_CODE"."ID", "LU_CSU_CODE"."DEP

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
', ) might map to my static/ or templates/ directories, for > instance. > > The third path ( '/home/user/web/project/../project', ) remains a > mystery... > > > That path just amounts to /home/user/web/project since .. just goes up a level. Alex -- "I di

Re: Multiple Select Check Boxes - newbie...

2009-03-09 Thread Alex Gaynor
greatly appreciated... > > Thanks > > > > I would change the schema to use an explict ManyToManyField(whcih is what you created yourself), and then it's just a MultipleModelChoiceFIeld with a CheckboxSelectMultiple widget. Alex -- "I disapprove of what you say, but I will defend to t

Re: Dynamically Changing Cache Settings

2009-03-09 Thread Alex Gaynor
t; > Do I even need to restart the apache instances if my memcached > settings change? > > Thanks! > > > If you're deployed under mod_wsgi I believe touching the WSGI file will cause it to reload the files. Alex -- "I disapprove of what you say, but I will defend to the

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
uot;stylesheet" > > The correct link: > type="text/css" /> > > I must have looked at that link dozens of times until I noticed it. > Apologies for cluttering the list with my brainlapse. > > > > FWIW I believe the appropriate ackrnym is PEBCA

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Alex Gaynor
looks OK when the database server and web server in the same > > > machine, but really slow when the web server to call a remote database > > > server because the plans is more than 2000, so it generate more than > > > 2000 database queries calls. > > > > I d

Re: Use a feature similar to the Admin sorting by date on my site?

2009-03-09 Thread Alex Gaynor
er write some code to do stuff like that, or I have a project called django-filter that tries to allow you to create similar interfaces for public views: http://github.com/alex/django-filter/tree/master Alex -- "I disapprove of what you say, but I will defend to the death your right to s

Re: Use a feature similar to the Admin sorting by date on my site?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 9:52 PM, Wiiboy wrote: > > But Django doesn't offer it bult-in? > > > Django doesn't have anything included to automatically create all that, but you can quite easily build it yourself. Alex -- "I disapprove of what you say, but I will def

Re: How to access an element in a list using forloop.counter in django templates?

2009-03-09 Thread Alex Gaynor
ter:forloop.counter }} #This > code is not working > { %endfor %} > > Regards > Rama vadakattu > > > > > > > > > > > > > is there a reason you can't just do {{ k }} why would an item be at a different position then it's i

Re: css framework

2009-03-09 Thread Alex Gaynor
m too dumb to understand how they work. 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: Insert insetad edition with model form

2009-03-10 Thread Alex Koshelev
What task_id do you send when editing the entry? On Tue, Mar 10, 2009 at 3:54 PM, Dmitry Teslenko wrote: > > Hello! > > I'm starting with django framework; I use django 1.0 and sqlite > database backend. > I've stumbled upon this thing: when editing model entry with ModelForm > I get insert inste

Re: How to apply filter to included template?

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 9:22 AM, jago wrote: > > Can I somehow apply an filter to an included template? > > {% include "header_viz_js.html" %} > > how? > > > This is untested but the filter tag would probably work {% filter myfilter %} {% include "template.jhtml" %} {% endfilter %} -- "I disap

Re: Encode Html for correct display in tags?

2009-03-10 Thread Alex Gaynor
On Tue, Mar 10, 2009 at 9:06 AM, jago wrote: > > Ok...the text in the docu also describes it for 0.96. Thanks! > > > Django .96 doesn't have HTML autoescaping. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Volt

Re: Category / Subcategory / Product

2009-03-10 Thread Alex Gaynor
d >> django-treebeard (both of them are on Google code and are the first hits >> if you search for their respective names). >> >> The django-mptt project contains some template tags to help display the >> data in templates. django-treebeard does not, from memory, although >&g

Re: Getting form and formsets to work with templates

2009-03-10 Thread Alex Gaynor
Works] > > How can I simply display the values of the fields and not make them > editable? > > > > > Django doesn't have a built in way to do a non-editable fields, I did a blog post on one way a little while ago: http://lazypython.blogspot.com/2008/12/building-read-only-f

Re: Order_by number of foreign key joins

2009-03-10 Thread Alex Gaynor
s possible with aggregation support in the Django development version/1.1 alpha and it looks like: Thing.objects.annotate(num_other=Count('other_thing')).order_by('num_other') Alex -- "I disapprove of what you say, b

Re: rank newbie - working thru 2.0 Book- basic template Tags give 'syntax error' on {%

2009-03-10 Thread Alex Gaynor
you need to put it in a string and use a template object as the djangobook shows(and all the docs do), not try to execute it at the Python prompt. 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: built-in views - register()

2009-03-10 Thread Alex Gaynor
t; > J > > > No, to my knowledge there is a historical reason for this as the auth code originally came from LJW and the registration stuff was very intertwined with their custom stuff so it didn't get extracted. However django-registration by James Bennet contains a very common

Re: Best practise of using custom sql with Stored Procedure

2009-03-10 Thread Alex Gaynor
i-19th-century-jpg', > u'c4a6afe0a71e3632', > 3, > u'[]', > 5, > False, > False, > False, > True, > True, > 1, > u'', > 1, > None, > False, > 1, > "'19th':4,9 'hokusai':3,8 'ts

Re: Using Model name in the url

2009-03-10 Thread Alex Gaynor
ing is, I haven't been able to find any documentation on using the > class name as a variable in this situation... > > Any thoughts? > > > Can you paste some of your code? It's my guess that the issue is that you need to reapply the permalink decorator on the inherited m

Re: Filter ALL requests before dispatching via URLs.py?

2009-03-10 Thread Alex Gaynor
> the required variables, and then dispatches to URLS.py? > > Cheers, > -Josh > > > You're probably looking for a template context processor, consult the docs for info on them. Alex -- "I disapprove of what you say, but I will d

Re: Validating interdependent inlines

2009-03-11 Thread Alex Gaynor
across forms in an inline, or across a single form does. 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

Re: Post Save Signal the best plan?

2009-03-11 Thread Alex Gaynor
of concept? > > Thanks > > > What I would do is overide save() and add an extra parameter "dont_calculate" or something that is False by default but that you can pass in when you don't want the calculations to occur. Alex -- "I disapprove of what you say,

Re: garbage collection on models after use?

2009-03-11 Thread Alex Gaynor
e code snippet: > > It's a reasonable guess, based on you not ruling it out, that you're > experiencing this: > > > http://docs.djangoproject.com/en/dev/faq/models/#why-is-django-leaking-memory > > Regards, > Malcolm > > > > > > Try this method:

Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
I'm trying to populate an admin form with the field names of of a model class, but I don't want to have to instantiate that model just to read it's fields from _meta. I basically want to do something like this: self.fields['sort_by'].choices = [(field.verbose_name, field.name) for field in field_

Re: Overriding UserManager

2009-03-11 Thread Alex Gaynor
>out_cols = self.get_columns(with_col_aliases) > File "C:\Python24\Lib\site-packages\django\db\models\sql\query.py", > line 588, in get_columns >col_aliases) > File "C:\Python24\Lib\site-packages\django\db\models\sql\query.py", > line 633, in get

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 10:33 AM, Alex Jillard wrote: > I'm trying to populate an admin form with the field names of of a model > class, but I don't want to have to instantiate that model just to read it's > fields from _meta. > > I basically want to do someth

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
Sorry Alex, I should have been more clear, I need to access the fields of another model. I went ahead and did what you said to try and get it working, and I was able to get the fields from the form's model, but I get an error when trying to assign them to the choices property of my field.

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote: > Sorry Alex, I should have been more clear, I need to access the fields of > another model. I went ahead and did what you said to try and get it > working, and I was able to get the fields from the form's model, but I get &

Simple Dynamic Form Problem

2009-03-11 Thread Alex G
one) .AttributeError: 'RFSInputForm' object has no attribute 'get' I'm hoping someone could enlighten me as to what the problem might be. I've distilled my experiment to the simplest possible instance, but the suggestion found at http://www.b-list.org/weblog/2008/nov/09/dy

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
If I override get_form in ShelfAdmin, I still get the same errors. self.fields is still None...any idea how to get access to the fields? On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote: > > > On Wed, Mar 11, 2009 at 11:18 AM, Alex Jillard wrote: > >> Sorry Alex, I sho

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Gaynor
On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote: > If I override get_form in ShelfAdmin, I still get the same errors. > self.fields is still None...any idea how to get access to the fields? > > On Wed, Mar 11, 2009 at 12:26 PM, Alex Gaynor wrote: > >> >> >>

Re: Accessing fields on uninstantiated model

2009-03-11 Thread Alex Jillard
Ah, that makes sense, thanks. With that change, I can use _meta.fields from my other model and everything works great. Thanks for the help On Wed, Mar 11, 2009 at 12:53 PM, Alex Gaynor wrote: > > > On Wed, Mar 11, 2009 at 11:50 AM, Alex Jillard wrote: > >> If I ov

Re: multiple views and templates

2009-03-11 Thread Alex Gaynor
info on them). The great thing about this is ebcause of the way querysets work you won't even have the overhead of an extra SQL query unless you use it since the queryset won't evaluate unless it's used :) Alex -- "I disapprove of what you say, but I will defend to the

Re: Help with adding custom validation to the admin

2009-03-11 Thread Alex Gaynor
a custom form: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#form and to set the fields automatically you should use the save_model hook: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#save-model-self-request-obj-form-change Alex -- "I disapprove of what you say, but I wil

Re: basic newbie question

2009-03-11 Thread Alex Gaynor
#x27;ve > imported the models so country should be there. I know there is > something simple I'm missing just can't figure out what. > > > What is county supposed to be here, perhaps you should paste the null view. Alex -- "I disapprove of what you say, but I will de

Re: basic newbie question

2009-03-11 Thread Alex Gaynor
or.objects.filter(county=c) >return render_to_response('county/county_detail.html',{'county':c, > 'Vendors': Vendors}) > > On Mar 11, 11:28 pm, Alex Gaynor wrote: > > On Wed, Mar 11, 2009 at 10:26 PM, nixon66 wrote: > > > > > Tryin

Re: How can I verify correction of the form with SelectMultiple widget field?

2009-03-12 Thread Alex Gaynor
ng them in the choices list. > > Regards, > Malcolm > > > > > > Alternatively you could use a TypedChoiceField(which may not be documented). It looks like you're working with models here so it may be easier for you

Re: traceback - no local variables

2009-03-12 Thread Alex Gaynor
a number of years ago that instead of sending the plain text traceback it sent an HTML email with the DJango DEBUG page. Perhaps someone remembers what I'm talking about. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The

Re: delete in formset by clearing fields instead of checkbox

2009-03-12 Thread Alex Gaynor
ave_existing_objects() and use that for the formset= > argument of inlineformset_factory()? > > > The method you propose of overiding save_existing_objects is how I'd do it. Alex -- "I disapprove of what you say, but I will defend to the death your rig

Re: Plugin based feature adding to web-application

2009-03-13 Thread Alex Gaynor
res and best practices. Any suggestion > would be really helpful. > > Thanks > Rav! > > > > I wrote something similar to this a while ago, here: http://github.com/alex/django-plugins/tree/master and while I haven't really maintained the code, nor does it work with the late

Re: How to submit a documentation patch

2009-03-13 Thread Alex Gaynor
there is nothing left > to add, but when there is nothing left to take away" > - Antoine de Saint Exupery > > > > Documentation patches are handled the same way as code patches, file a ticket, upload a .diff, and someone will review it, and eventually a committer will commit

Re: Simple Dynamic Form Problem

2009-03-13 Thread Alex G
/sigh I knew it was going to be something like this. I'm sorry to have troubled you :-/. Thank you, JKM. On Mar 12, 9:31 pm, Jacob Kaplan-Moss wrote: > On Wed, Mar 11, 2009 at 11:30 AM,Alex G wrote: > > > Having referencedhttp://www.b-list.org/weblog/2008/nov/09/dynamic-

Re: Template POST problems

2009-03-13 Thread Alex Gaynor
gt; return render_to_response("contact_success.html") > > > Now when i hit the send button, i get a django error page stating that > my view isn't being passed any key values. When i look down the error > page i see that there is no post data. I'm a little uns

Re: Best practise of using custom sql with Stored Procedure

2009-03-14 Thread Alex Gaynor
which automatically turns a tuple into arguments, for some reason I thought you had a dict there. 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: precision for float values in template rendering

2009-03-14 Thread Alex Gaynor
redefined way to control the > precision in the rendering of template instead of having to re-format > the output of the float in my code. > > thanks. > > > Take a look at the floatformat filter: http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#floatfo

Re: Martin Winkler's "Captcha for Django"

2009-03-14 Thread Alex Gaynor
html = u''' > value="captcha.%(hiddentext)s" > > /> > />''' % > > {'name':name, > > 'hiddentext': self.hiddentext, > > 'imageurl': self.imageurl } > > > > +retu

Re: foreign key id as part of models.FileField(upload_to=...)

2009-03-14 Thread Alex Gaynor
the path, but how? > Any hint will be appreciated. > > Thanks, > Christoph > > > You can do this by providing a callable to upload_to: http://docs.djangoproject.com/en/dev/ref/models/fields/#filefield . Using the instance, so this might look like:: def upload_location(instance,

Re: GET vs POST?

2009-03-14 Thread Alex Gaynor
? > > Thanks. > > > You can instantiate a form with request.GET just the same as you can with request.POST. MyForm(request.GET) works just fine. Alex -- "I disapprove of what you say, but I will defend to the death your right

Re: ImportError: Could not import settings, but with an EACCES puzzle

2009-03-14 Thread Alex Gaynor
is ext3, no funny business (that I know > about) with ACLs or anything. Just a bog-standard CentOS 5.2. > > Linux myhostname 2.6.18-92.el5PAE #1 SMP Tue Jun 10 19:22:41 EDT 2008 > i686 i686 i386 GNU/Linux > > > > > This isn't stricly related, probably, but you generally sho

Re: Beginner

2009-03-15 Thread Alex Gaynor
3:26 pm, TP wrote: > > > > > I have just started to use Django on a Linux machine and when trying > > > to create a new problem I get the following error: > > > > > django-admin.py: command not found > > > > > Any suggestions ? > > >

Re: Vanity urls: Eg mysite.com//....

2009-03-15 Thread Alex Gaynor
s with this approach? >> >> > > > > Most people structure their URLs that way since Django makes it nice to have these pretty urls. That being said I'd probably write out the full user/group just because it makes the urls a little more se

Re: Aggregation Questions

2009-03-16 Thread Alex Gaynor
t; > Regards > Koran > > > > > > Right now that isn't possible, is there any reason you couldn't just bring the seperate SUMs into python and do the subtraction there, I realize it isn't quite as clean but the overhead should be minimal? Alex -- "I disapprov

Re: Simple sites framework question

2009-03-16 Thread Alex Gaynor
if so it looks like: if instance.sites.filter(id=1): do stuff which is hopefully clear in what it does, if you're trying to do something else you'll have to clarify. Alex -- "I disapprove of what you say, but I will defend to the death

Re: Aggregation Questions

2009-03-16 Thread Alex Gaynor
On Mon, Mar 16, 2009 at 11:52 AM, koranthala wrote: > > > > On Mar 16, 8:14 pm, Alex Gaynor wrote: > > On Mon, Mar 16, 2009 at 11:07 AM, koranthala > wrote: > > > > > Hi, > > >I downloaded Django 1.1 due to aggregation support. > > &g

Re: Switching database backends at runtime?

2009-03-16 Thread Alex Gaynor
/easy-multi-database-support-django/except for if you're using django trunk you can use django.db.load_backend and the new DatabaseWrapper constructor(which takes a dict of settings) to do it, instead of futzing with the global settings. Alex -- "I disapprove of what you say, but I

Re: Saving model with raw=True

2009-03-16 Thread Alex Gaynor
l and doesn't seem like behavior you'd ever want to chnage: http://code.djangoproject.com/browser/django/trunk/django/db/models/base.py#L352 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: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Alex Gaynor
e we close bugs for the final release. If you > > > don't get an immediate response, be patient and wait until a bit after > > > the release when we all have a bit more time. > > > > > Jacob > > > One possibility would be to use 2 cookies, one the norm

Re: schema to model

2009-03-16 Thread Alex Gaynor
/sky > > > > Yep, checkout the "inspectdb" management command: http://docs.djangoproject.com/en/dev/ref/django-admin/?from=olddocs#inspectdb Alex -- "I disapprove of what you say, but I will defend to the death your right to say it.&qu

Re: best way to organize models that store businesses/hours?

2009-03-16 Thread Alex Gaynor
e.datetime.now().hour) I guess technically you could just have 14 fields on the mode(open and close for each day of the week), which is fine since days of the week are a static number of things but that felt bulky to me(though it's probably more preformant). Alex -- "I disapprove of what

Re: Starting custom settings with django-admin.py failed

2009-03-17 Thread Alex Robbins
ath) 2. There is a syntax error in your settings file. To check for this you could just run "python /path/to/your/settings.py" from the shell. See if that exits with errors. Happy Djangoing! Alex On Mar 16, 8:47 am, Joshua Partogi wrote: > Dear all, > > I have a custom setting

Re: Username Blacklist

2009-03-17 Thread Alex Gaynor
me sort of built in 'blacklist'? > > Regards, > Andrew > > > > One way is to actively validate these, another is to just list that URL pattern after your other ones, so that if someone goes to /admin/ it goes to your admin, no they're profile. Alex -- "I

Re: beginner model question - two tables without foreign keys (myslq - myisam)

2009-03-17 Thread Alex Robbins
gnKey('Book') Then you could get that data like this: title = "The book's title" book = Book.objects.get(title=title) phrase = Phrase.objects.get(book=book) Now you have all the objects you need, just access their data like normal python objects. book.title phrase.text H

Re: Poll Tutorial regarding __unicode__

2009-03-17 Thread Alex Gaynor
; File "/home/cserv2_a/ug/scs5tdp/Desktop/mysite/mysite/settings.py", > line 79 >'mysite.polls'python > > > > Does this mean there is something wrong where I have added 'import > datetime' to my code? > > > Part of your traceback got cut

Re: Username Blacklist

2009-03-17 Thread Alex Gaynor
On Tue, Mar 17, 2009 at 8:35 AM, Andrew Turner wrote: > > 2009/3/17 Alex Gaynor : > > One way is to actively validate these, another is to just list that URL > > pattern after your other ones, so that if someone goes to /admin/ it goes > to > > your admin, no th

Re: best way to organize models that store businesses/hours?

2009-03-17 Thread Alex Gaynor
On Tue, Mar 17, 2009 at 10:56 AM, luxagraf wrote: > > Alex- > > Thanks for the suggestions... the 14 fields is definitely an option, > but like you said it feels awkward and would make it hard to adapt > should things change down the road. > > Darryl - > > >

Re: Problem with formsets and uploading of files

2009-03-17 Thread Alex Gaynor
> Any help will be appreciated. > > > Regards, Stefan > > > > > You should be calling `is_valid` as it's a function, not a property: attachmentset.is_valid() Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --V

Re: Numbering of items in template

2009-03-17 Thread Alex Koshelev
You can use `forloop.counter` with `sum` filter. Or use `ol` html tag with proper `start` attribute. On Tue, Mar 17, 2009 at 7:47 PM, Jesse wrote: > > Hello, > > I've finally gotten pagination to work.  Now I would like to add a > sequential number to the beginning of each record in the output.

Re: Numbering of items in template

2009-03-17 Thread Alex Gaynor
cord_list %} >{{ forloop.counter }}: {{ record }} > {% endfor %} > > Jacob > > > > Jacob, if I understand the issue is that on the 2nd page he wants to start the count at 101, not 1. Alex -- "I disapprove of what you say, but I will defend

Re: Django book mostly done?

2009-03-17 Thread Alex Gaynor
. If you haven't already I would take a look at the official django docs/tutorial, they really are quite good :). 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."--Cic

Re: objects.filter (calling a method) ?

2009-03-17 Thread Alex Gaynor
e's no way to do pure python filtering using the filter() method. If you want you can do it using the Python filter function: qs = filter(lambda obj: obj.method() > 0, qs). But remember that will need to pull in all possible records from the DB to do that filtering. Alex -- "I disap

Re: RelatedObject Cache

2009-03-17 Thread Alex Gaynor
to anyone who can help! > > -- Andrew > > > The code to calculate the cache is here: http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py#L171it's a lot to follow but it gets used in ReverseSingleRelatedObjectDescriptor which calls self.field.get_ca

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