Re: Filebrowser No thumbnail generation

2009-02-21 Thread leau2001
Patrikk, Not any thumbnails was created.. image generator just create the directory with the file name ... but doesn't create any thumbnail file on it... but original is well download... /filename_thumbail_directory/...nothing filname_original.jpg looks like PIL doesn't do his job... i m sure

Two Dimentional Form Data Arrays

2009-02-21 Thread ajt111
I want to create a multi-dimentional arry in a form element and convert that to a list of dicts. My form element looks like this: What I was hoping to have was an arry named search with a key of result.NAME and a value of result.CODE that looks like this: search [ NAME1=>CODE1

Re: broken url error in admin

2009-02-21 Thread James Bennett
On Sat, Feb 21, 2009 at 11:52 PM, Jlcarroll wrote: > What is the best way to fix this? What if someone wants to enter a > broken url in an admin page? What if the url isn't broken, just > requires a login? Please read the documentation for URLField, which explains how to

Re: increase integer

2009-02-21 Thread rajeesh
Try to modify your form_action to "/mysite/count/{{ number }}" and edit urls.py to change corresponding rule as something like r'/mysite/ count/(?P\d*)'. Doesn't that render_to_response line contains a typo? It must be {'number':new_number}. --~--~-~--~~~---~--~~

Re: How to populate a custom ModelForm?

2009-02-21 Thread rajeesh
Well, Let me re-phrase that question: I'm currently using the following line of code to populate text_input fields in the custom form: form.base_fields['r_date'].widget.attrs['value'] = obj.transaction.trans_date But is this acceptable way of coding? If yes, how can I populate ChoiceFields?

Re: how to make a field uneditable in admin site

2009-02-21 Thread legutierr
On Feb 18, 9:14 pm, Malcolm Tredinnick wrote: > On Wed, 2009-02-18 at 18:07 -0800, adelevie wrote: > > According to Djangobook, the philosophy of theadminsite is that all > > users of it are "trusted" not just "authenticated," meaning you will > > trust them to do the

increase integer

2009-02-21 Thread eenp...@gmail.com
hi, I trying to increase a number by hitting a submit button. So each time you hit the button the site shows an increasing number. How can I show each time the next number? my "count.html" - {{ number }} my "view.py"

passing arguments in HttpResponseRedirect(reverse())

2009-02-21 Thread Guri
Hi, I need help in solving two small problems. 1. A form submitted, after validation calls HttpResponseRedirect (reverse('view.get_links',args=(request.POST['data']))) In url pattern (r'^links/(?P.*)/',get_links), I am trying to send one more argument along with "request.POST

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

2009-02-21 Thread Andrew Godwin
That would work, except, as you say, computed values throw it off, and, at least in my opinion, instantiating fields in the same way they're defined in the models.py is the most sure-fire way to get things working. It also has the nice side-effect of making the stored values of the fields more

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

2009-02-21 Thread Alex Gaynor
On Sat, Feb 21, 2009 at 5:48 PM, Andrew Godwin wrote: > > Heh, as I expected. > > So, when I first started on South, I initially tried introspecting the > various fields to drag their parameters out of wherever they had been > saved to - for example, max_length in a field

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

2009-02-21 Thread Andrew Godwin
Heh, as I expected. So, when I first started on South, I initially tried introspecting the various fields to drag their parameters out of wherever they had been saved to - for example, max_length in a field goes to self.max_length. Then, you have the special cases for Django core fields. For

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

2009-02-21 Thread Alex Gaynor
On Sat, Feb 21, 2009 at 2:54 PM, Andrew Godwin wrote: > > Hello everyone, > > I'm currently working on the next version of South > [http://south.aeracode.org], and I need some test fodder for our new > models.py parser - rather than our previous approach using regexes and a

Re: Filebrowser No thumbnail generation

2009-02-21 Thread patrickk
could you be a bit more specific? what exactly works? what not? it seems that you can upload an image but the thumbnail is not created. do you mean the actual "thumbnail" or one of the image- versions named "thumbnail"? patrick On Feb 21, 11:50 am, leau2001 wrote: > Hi, >

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

Default email value for django.contrib.comments?

2009-02-21 Thread pmains
I'm writing a blog app (yeah, I know. super boring, right?), and I was running into a strange issue where user comments were being issued a default email address. Is there any way to prevent this from happening? The URL field is fine -- no default value is being set there. I'm using

Call for horrible (or nice) models.py files

2009-02-21 Thread Andrew Godwin
Hello everyone, I'm currently working on the next version of South [http://south.aeracode.org], and I need some test fodder for our new models.py parser - rather than our previous approach using regexes and a reasonable amount of hope, this time it's being done properly, using the python parsing

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

2009-02-21 Thread Nate Morse
Before I go down the road of writing SQL by hand or using QuerySet.extra(...) [ don't know much about that yet:], I thought I would ask if there is a way to achieve (within the QuerySet methods) something like ...WHERE field_a = 'abc' OR field_b = '123' ...? It seems if I do: rs =

Re: Lookup across relations

2009-02-21 Thread Daniel Roseman
On Feb 21, 7:27 pm, 3xM <3...@detfalskested.dk> wrote: > I've got 2 models: > > > class Person(models.Model): >     ... > > class Project(models.Model): >     ... >     persons = models.ManyToManyField(Person) > > > Now, how do I lookup Projects including person_a and person_b? > > I've

How to populate a custom ModelForm?

2009-02-21 Thread raj
I've defined a custom ModelForm for one of my models. Many of the custom form fields differ from the model fields. I've made the 'save_model' method to calculate required model_field_values from the given form_field_values. Now after adding one instance, how can I do the reverse? I mean, how to

Re: Writing custom model fields with Multi-table inheritance

2009-02-21 Thread gordyt
> http://code.djangoproject.com/ticket/8813 > > If you could attach the file you dpasted to that ticket and note that you > see this problem in the admin, that would probably be useful, as recreating > it in admin should be easier than recreating the user-defined form, view, > and models involved

Lookup across relations

2009-02-21 Thread 3xM
I've got 2 models: class Person(models.Model): ... class Project(models.Model): ... persons = models.ManyToManyField(Person) Now, how do I lookup Projects including person_a and person_b? I've tried chaining filters like this, but that won't work (returning no results):

Re: Problem outputting date in template as timestamp

2009-02-21 Thread Sean Brant
BTW, That is with a timezone of "America/New_York" On Feb 21, 1:05 pm, Sean Brant wrote: > Would something like this work? > > def U(self): >     "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)" >     import calendar >     timestamp =

Re: Problem outputting date in template as timestamp

2009-02-21 Thread Sean Brant
Would something like this work? def U(self): "Seconds since the Unix epoch (January 1 1970 00:00:00 GMT)" import calendar timestamp = calendar.timegm(self.data.timetuple()) return timestamp + time.timezone Test: r""" >>> print dateformat.format(my_birthday, 'U') 40437 """

Adding an already uploaded image to ImageFileField

2009-02-21 Thread TiNo
Hi, I want to add already uploaded images to a models ImageFileField. I finally managed to do this as follows: (in the shell): --- from trips.models import Event from leden.models import Lid from foto.models import Foto from django.core.files.base import File

Re: is_authenticated

2009-02-21 Thread Chris Czub
If you are using default Django sessions, they will be stored in the database. >From the docs: By default, Django stores sessions in your database (using the model django.contrib.sessions.models.Session). Though this is convenient, in some setups it's faster to store session data elsewhere, so

is_authenticated

2009-02-21 Thread Tim
Hi - I am using the Django auth backend and I'd like to test which users are currently logged in. I can't do this just by grabbing User.objects.all() and testing each with is_authenticated, because the User objects being User objects as opposed to AnonymousUser objects will always return True

Re: django spreadsheet

2009-02-21 Thread David M. Besonen
On 2/21/2009 7:01 AM, Alex Gaynor wrote: > On Sat, Feb 21, 2009 at 6:02 AM, David M. Besonen > wrote: > >> has anyone seen any django code with spreadsheet-like >> functionality? >> > What do you mean spreadsheet functionality? Do you mean a > website like google docs? yes.

Re: Set a URL to be handled by PHP

2009-02-21 Thread adelevie
You could also create a rest-like interface with php if all you're really doing with php is server side processing. On Feb 20, 9:08 am, Matt McCants wrote: > Hey there, > > Try setting the Handler to None just like you do with your media > directory. With a basic PHP

Re: NoReverseMatch for a named URL

2009-02-21 Thread Philippe Clérié
You were right! There was a missing view! Thanks! -- Philippe -- The trouble with common sense is that it is so uncommon. On Friday 20 February 2009 18:11:44 Briel wrote: > I've seen errors like this when an url is missing a view to link > to. All urls defined must have a view

Re: Use model of non-installed app

2009-02-21 Thread TiNo
On Sat, Feb 21, 2009 at 16:04, Alex Gaynor wrote: > > > On Sat, Feb 21, 2009 at 7:50 AM, TiNo wrote: > >> >> Hi, >> >> I am trying to use a model from an app that is on my python path, but >> not in the INSTALLED_APPS setting. But I can't get it to work.

Re: NoReverseMatch for a named URL

2009-02-21 Thread Philippe Clérié
Thanks. I checked carefully and all the defined URLs do have a view defined. There are no apparent problems with the templates. And this morning I'm getting a new error. A named url is reversed correctly but the page is not found. Yesterday, it was found all right. Curiouser and curiouser!

Re: Use model of non-installed app

2009-02-21 Thread Alex Gaynor
On Sat, Feb 21, 2009 at 7:50 AM, TiNo wrote: > > Hi, > > I am trying to use a model from an app that is on my python path, but > not in the INSTALLED_APPS setting. But I can't get it to work. > > Why would I want this? DRY. I want to use parts (ex. the 'PhotoSize' > model) of a

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: >

Re: django spreadsheet

2009-02-21 Thread Alex Gaynor
On Sat, Feb 21, 2009 at 6:02 AM, David M. Besonen wrote: > > has anyone seen any django code with spreadsheet-like > functionality? > > > > What do you mean spreadsheet functionality? Do you mean a website like google docs? Or do you mean the ability to read or generate excel

Displaying Generic Read-Only Model Data

2009-02-21 Thread Chris
What's the best way to display generic read-only model data on a template, without having to manually write the html for each column you want displayed? I'm toying around with a ModelForm, using custom form widgets to format the data into strings instead of form fields. Is there a better way?

Use model of non-installed app

2009-02-21 Thread TiNo
Hi, I am trying to use a model from an app that is on my python path, but not in the INSTALLED_APPS setting. But I can't get it to work. Why would I want this? DRY. I want to use parts (ex. the 'PhotoSize' model) of a 3rd party app (ex. photologue), without it filling my database with tables

Using Admin Datepicker in Other Apps

2009-02-21 Thread Chris
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/DateTimeShortcuts.js admin/RelatedObjectLookups.js calendar.js core.js

Importing data from a "swisscheese" database, need some feedback

2009-02-21 Thread Adys
Hi list! I've been working for the past months or so on a project that reuses imported data. This data is extremely unreliable. I have to set up a lot of stuff to normalize it throughout Django. However there is still a field I haven't covered decently, ForeignKeys. I have a good hundred

Filebrowser No thumbnail generation

2009-02-21 Thread leau2001
Hi, I try to use filebrowser in my project, all is fine, but when i use image generator, the rep was create but not any thumbnail... PIL is on my python Used django 1.0.2 released whats wrong ? thx lo --~--~-~--~~~---~--~~ You received this message because

django spreadsheet

2009-02-21 Thread David M. Besonen
has anyone seen any django code with spreadsheet-like functionality? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To