Re: Handling admin media paths in the transition from 1.3 to 1.4

2011-10-03 Thread Aramgutang
Realised after posting that this belongs in django-developers. Reposted there. Sorry about that. -- 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 unsubscribe from this group,

effective adding records in Django site admin

2011-10-03 Thread veva...@yandex.ru
Good morning! Could you tell me, is there any solution to add several records? 1) Now we can click Add, this gives us an empty version of the edit page. I believe it is comfortable to have a Copy button, clicking Copy would give us a page with a copy of a previuosly selected record, we could edit

Handling admin media paths in the transition from 1.3 to 1.4

2011-10-03 Thread Aramgutang
Currently, it is unclear as to how apps that override admin templates should maintain compatibility with both 1.3 and 1.4 when referring to the admin media file URLs in the overridden templates. This applies primarily to third-party apps like django-admin-tools, that want to support at least the

Python 2.7+Windows 7+Django1.4 + Apache2.2 +mod_wsgi

2011-10-03 Thread Mac
For what it's worth, on Windows I like to use Apache2.2 for development purposes instead of the built in server that you have to fire up using the shell command, manage.py runserver every time you need it. On a Windows 7 machine, I followed the instructions to set up my apache server with django

Re: "Dynamic" Typing for Models?

2011-10-03 Thread momo2k
A minute ago I have understood what proxy inheritance is good for. sorry! On 4 Okt., 01:26, momo2k wrote: > Hello, > > this may be a python-general question, but it came across my way while > working with django: > Imagine you have a model: > > class A(Model) >     name =

Return a CSV and a template in the same response.

2011-10-03 Thread Jack
Hey gang, I am trying to use a response object to serve a dynamically created CSV. I have that part working perfectly but I'd like to display a page afterwards with a summary of the data. Is there a good way to do this? I tired added the rendered template to the httpresponse object after I

Re: Cloudfiles Storage Backend

2011-10-03 Thread Kurtis Mullins
Django-cumulus is exactly what I was looking for. Unfortunately, I can't get it to work right with Django 1.3. Have you had any luck with that? On Tue, Sep 27, 2011 at 2:20 PM, Eric Hutchinson < eric.hutchin...@burgopakusa.com> wrote: > django cumulus does this with the directory hierarchy just

Re: Return a CSV and a template in the same response.

2011-10-03 Thread Tim Chase
On 10/03/11 17:53, Jack wrote: Hey gang, I am trying to use a response object to serve a dynamically created CSV. I have that part working perfectly but I'd like to display a page afterwards with a summary of the data. Is there a good way to do this? I tired added the rendered template to the

"Dynamic" Typing for Models?

2011-10-03 Thread momo2k
Hello, this may be a python-general question, but it came across my way while working with django: Imagine you have a model: class A(Model) name = CharField() type = SmallIntegerField(choices=SOME_TYPES) def do_something(self): fancy_things I want do_something() do

Re: How REST Access ?

2011-10-03 Thread Brian Mehrman
Thanks for the info. I didn't know about either tastypie or piston. The easy ability to throttle a users number of requests is awesome. -Brian On Mon, Oct 3, 2011 at 12:40 PM, sanket wrote: > please checkout Tastypie .. I was able to RESTify my django app in >

Re: How REST Access ?

2011-10-03 Thread sanket
please checkout Tastypie .. I was able to RESTify my django app in couple of hours On Oct 3, 8:37 am, Donald Stufft wrote: >  TastyPie is also good and one that I prefer over Piston. > > > > > > > > On Monday, October 3, 2011 at 11:20 AM, Javier Guerra Giraldez

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Shawn Milochik
On Mon, Oct 3, 2011 at 10:30 AM, Victor Hooi wrote: > heya, > @Shawn: Hmm, that looks like quite an interesting approach - so the > ModelForm would handle the validation logic? =) Me likes! Haha. > I can parse the CSV and get the field names to match up (or just do a simple

Re: how to match a url in urls.py

2011-10-03 Thread Bjarni Rúnar Einarsson
The complaint about invalid ranges probably stems from the fact that you have '-' in the middle of your character lists. If you do not mean [a-z], you should always make the dash the last character, like so: [az-]. The expression as pasted is requesting ranges [w-:] in a couple of places, which

Re: How to do some additional process while saving a django flatpage

2011-10-03 Thread Swaroop Shankar V
Thanks a lot Daniel, I guess this is exactly what I require. Will check it and revert back. Thanks and Regards, Swaroop Shankar V On Mon, Oct 3, 2011 at 4:21 PM, Daniel Roseman wrote: > On Sunday, 2 October 2011 15:03:12 UTC+1, Swaroop Shankar wrote: >> >> Hi, >> I am

Re: how to match a url in urls.py

2011-10-03 Thread Javier Guerra Giraldez
On Mon, Oct 3, 2011 at 9:56 AM, He Jibo wrote: >    (r'^pagerank/(?P([/w-]+/.)+[/w-]+.([^a-z])(/[/w-: > ./?%&=]*)?|[a-zA-Z/-/.][/w-]+.([^a-z])(/[/w-: ./?%&=]*)?)', > 'ueseo.pagerank.views.CheckPageRankStatic'),# a static page version of page > rank check is that a copy/paste?

Re: How REST Access ?

2011-10-03 Thread Donald Stufft
TastyPie is also good and one that I prefer over Piston. On Monday, October 3, 2011 at 11:20 AM, Javier Guerra Giraldez wrote: > On Fri, Sep 30, 2011 at 10:23 PM, bino oetomo (mailto:b...@indoakses-online.com)> wrote: > > Dear All. > > > > Kindly please give me

Re: How REST Access ?

2011-10-03 Thread Javier Guerra Giraldez
On Fri, Sep 30, 2011 at 10:23 PM, bino oetomo wrote: > Dear All. > > Kindly please give me your enlightment to CRUD Django database using > HTTP-GET. first of all, REST is not CRUD. you'll get in a world of pain if you simply expose your database. second, check

Re: how to match a url in urls.py

2011-10-03 Thread Brian Mehrman
Hi He, I always try to break my regex's down to their simplest components, then test them here, http://www.regular-expressions.info/javascriptexample.html. Try testing each part of your regex there and see if you can see which part is broken. Also an example url of what you are trying to match

Re: Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
Thanks for your answer! I will check if it really fit my need G. On 3 oct, 15:58, Shawn Milochik wrote: > That's what a custom manager is for: > > https://docs.djangoproject.com/en/1.3/topics/db/managers/#custom-mana... > > So you can replace your Book.objects with another

how to match a url in urls.py

2011-10-03 Thread He Jibo
Hello, I want to match a url in urls.py. Can you teach me how to do it? Thanks.I have tried the following two versions. But as long as I put a . (dot) in the regular expression, it gives me a "bad character range" error. (r'^pagerank/(?P*([/w-]+/.)+[/w-]+.([^a-z])(/[/w-:

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Victor Hooi
heya, @Shawn: Hmm, that looks like quite an interesting approach - so the ModelForm would handle the validation logic? =) Me likes! Haha. I can parse the CSV and get the field names to match up (or just do a simple transform to get them to match). However, how do I then pass this information

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Shawn Milochik
A clean way would be to read in the CSV with csv.DictReader, and ensure that the key names match your field names. Then use a ModelForm for your model, and pass in each dict as the 'data' field. This lets you re-use all the hard work already done in the ModelForm, because the is_valid() method

Re: Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Daniel Roseman
On Monday, 3 October 2011 14:42:36 UTC+1, Victor Hooi wrote: > > heya, > > I'm coding up a Django form which will let the user upload a CSV file, then > create and save multiple Model instances for each row in the CSV file. > > At the moment, I'm trying to decide where to put the code that parses

Re: Overwriting queryset from models for templates

2011-10-03 Thread Shawn Milochik
That's what a custom manager is for: https://docs.djangoproject.com/en/1.3/topics/db/managers/#custom-managers So you can replace your Book.objects with another Manager(), or add another manager to be used for your custom stuff. -- You received this message because you are subscribed to the

Re: Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
Thanks for your quick answer I know that I can do that, of course, but this is not my question, i just want to know if it's possible and how, I mean overwriting queryset with others values not dependant of models instances, and be able to retrieve them from templates as part of objects Thanks

Import CSV to create multiple Models - Model Manager or in View?

2011-10-03 Thread Victor Hooi
heya, I'm coding up a Django form which will let the user upload a CSV file, then create and save multiple Model instances for each row in the CSV file. At the moment, I'm trying to decide where to put the code that parses the CSV file and creates/saves the models. I don't think it'd be an

Re: Overwriting queryset from models for templates

2011-10-03 Thread BILLION Sébastien
Hi, Why don't you add a BooleanField in your Book model ? BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http://www.sebastienbillion.com/ Le 03/10/2011 15:00, gregory semah a écrit : Hi everyone, I'm

Overwriting queryset from models for templates

2011-10-03 Thread gregory semah
Hi everyone, I'm trying to create queryset of objects by adding for example a True/ False string for each objects Example: Normally a queryset of book in views could be books = Book.objects.all() I want to add in the books queryset, and for each book object a True/ False information in order to

Re: Using render() with Form?

2011-10-03 Thread Victor Hooi
heya, Aha, thanks guys. I can confirm that works fine now. That'll teach me to read the API docs a bit better...lol, I just assumed it was a 1-to-1 swap with render_to_response, didn't check the arguments =). Cheers, Victor -- You received this message because you are subscribed to the

Form validation with ImageFields

2011-10-03 Thread David
Hello I need to upload an image through a form. I also need to have the ability to use the "clear" checkbox built into the imagefield widget to have the image reference in the database removed. Images should also be checked for filetype, dimensions and rejected if appropriate. So I did this:

Re: Using render() with Form?

2011-10-03 Thread Sebastian Goll
On Mon, 3 Oct 2011 05:17:49 -0700 (PDT) Victor Hooi wrote: > from django.shortcuts import render > ... > def upload_file(request): > ... > return render('upload_form.html', {'form': form}) "render" requires as its first argument the request object supplied to your view

Re: Using render() with Form?

2011-10-03 Thread Daniel Roseman
On Monday, 3 October 2011 13:17:49 UTC+1, Victor Hooi wrote: > > heya, > > I was previously using the following to render a form: > > from django.shortcuts import render_to_response, RequestContext > ... > def upload_file(request): > ... > return render_to_response('upload_form.html', {'form':

Re: MS-SQL server support for DJango

2011-10-03 Thread David Markey
Did you try google? http://code.google.com/p/django-mssql/ was the first result for "mssql django" On 3 October 2011 07:59, Ashith wrote: > I am using Reviewboard for code review process in our organization. > Currently I am using sqlite3 backend for reviewboard

Using render() with Form?

2011-10-03 Thread Victor Hooi
heya, I was previously using the following to render a form: from django.shortcuts import render_to_response, RequestContext ... def upload_file(request): ... return render_to_response('upload_form.html', {'form': form}, context_instance=RequestContext(request)) I can confirm that this works

Re: Getting a count of a RawQuerySet object

2011-10-03 Thread prajakta-dravid
Use len(list(RawQuerySetName)) On Sep 21, 10:08 pm, Jack Morgan wrote: > Hi, thanks! > The issue I'm getting here is that the RawQuerySet object does not have the > .count() method so it just gives an error. > I also just checked that it does not have the 'all()' method

MS-SQL server support for DJango

2011-10-03 Thread Ashith
I am using Reviewboard for code review process in our organization. Currently I am using sqlite3 backend for reviewboard since my boss hasn't approved installing MySQL on the reviewboard server which is already running MS-SQL server. Even though I am not a great big fan of MS-SQL I have to adhere

Re: can't get STATICFILES to work (Django dev version)

2011-10-03 Thread Gelonida N
On 09/26/2011 10:21 PM, nara wrote: > I am having trouble getting STATICFILES to work. I have read the docs, > and followed the instructions, but I never get my css files to load. > My current workaround is to put all the css inline in my template > file, but that should not be a permanent

Re: How to do some additional process while saving a django flatpage

2011-10-03 Thread Daniel Roseman
On Sunday, 2 October 2011 15:03:12 UTC+1, Swaroop Shankar wrote: > > Hi, > I am trying to build a menu system which can be controlled at the admin > area. For the content management purpose i am using django flatpage. So when > a page is getting saved i need to insert the page title and url in

Re: MAPI Email Backend available for testing

2011-10-03 Thread Kevin
Okay, so I manages to install the Win32 extensions for Python and the above Backend will not work, unless perhaps you use an older version of windows or exchange. That code seems outdated. Here is code that is verified to work with Windows 7 and Outlook 2010, it should work with others as this

Re: How to do some additional process while saving a django flatpage

2011-10-03 Thread Swaroop Shankar V
Hello Phang, Thanks for your reply. Well the requirement is like when ever a page is created i want to save an entry into the menu table to. This is to be an automatic process. If i understand correctly, the method you suggested will require a manual process or a cron running to fetch the data

Re: Django Registration extra fields not getting saved

2011-10-03 Thread Swaroop Shankar V
Hello Sébastien, Thanks for your response. I just figured out the issue. Actually signals was not getting called. The reason was that the django-registration was not installed properly. Actually i copied the django-registration folder to my project folder instead of the normal installation. Once

Re: Django Registration extra fields not getting saved

2011-10-03 Thread BILLION Sébastien
Hi, Can you send your signals.py? I think you have a problem with your signal BILLION Sébastien the Answer to the ultimate question of life, the universe and everything is 42 http://www.sebastienbillion.com/ Le 01/10/2011 10:59, Swaroop Shankar a écrit :

MAPI Email Backend available for testing

2011-10-03 Thread Kevin
I noticed that Django does not include a MAPI Backend for sending Email, for some environments having this type of backend is essential for testing and debugging. I do not recommend it as a production backend unless you are a full exchange shop, as some are and do not offer SMTP for internal

Re: loaddata and auto_now_add=True

2011-10-03 Thread Phang Mulianto
i think bcoz load data does not use the orm api..while your test use orm to insert data.. On Oct 3, 2011 3:43 PM, "Reikje" wrote: > Hi, I have a test fixture file which I use in unit tests. In some > Models I have date fields defined like this: >

Re: View decorator for common navigation elements?

2011-10-03 Thread Thomas Orozco
Maybe you can use template inheritance and have the base template access the data through, alternatively, template filters or instance methods? To make those work, you can take advantage of the existing template processors (notably the auth one). If you want to not have the topnav on a

loaddata and auto_now_add=True

2011-10-03 Thread Reikje
Hi, I have a test fixture file which I use in unit tests. In some Models I have date fields defined like this: models.DateTimeField(auto_now_add=True) for which I don't specify values in the fixture file (users.json). This works well as part of testing but when I want to load the fixture into the

Re: How to do some additional process while saving a django flatpage

2011-10-03 Thread Phang Mulianto
why not query your flatpage db and use the field for the menu in ur table.. flatpage have url and title.. get url n title and put in your menu template..no need signaling can add cache to as the flatpage not modified to often.. On Oct 2, 2011 10:03 PM, "Swaroop Shankar V"