Re: delete a field( many to many)

2011-11-09 Thread jose osuna perez
Sorry xD Hi, i wrote the same text in a Spanish blog xD, well I explain my problem, I have a table that has the following model: class Proyectos(models.Model): titulo=models.CharField(max_length=100) creacion=models.DateField(default=datetime.datetime.now) estado=models.CharField(max_l

Re: 2 settings files importing one to the other - problem

2011-11-09 Thread Nikhil Verma
make one file settings_local put all your local settings on that file and in seettings.py file just write from settings_local import * in settings.py file.Be careful about the path. On Thu, Nov 10, 2011 at 11:45 AM, RKumar Its mee wrote: > I hope you much have tired with Git repository. When you

Re: delete a field( many to many)

2011-11-09 Thread nicolas HERSOG
English please 2011/11/9 jose osuna perez > Hola, bueno les explico mi problema, tengo 1 tabla que tiene el > siguiente modelo: > > class Proyectos(models.Model): >titulo=models.CharField(max_length=100) >creacion=models.DateField(default=datetime.datetime.now) >estado=models.CharFie

Re: ImportError: No module named profiles

2011-11-09 Thread nicolas HERSOG
Can you show us your script and how you launch it ? On Wed, Nov 9, 2011 at 9:27 PM, Alfredo Alessandrini wrote: > Hi, > > I'm running a script to make a query with django. > > I need to run it in crontab. > > When I run it I get this error: > > ImportError: No module named profiles > > I'm using

Get the current url in django template

2011-11-09 Thread Asif Jamadar
I want to display the current url in django template. I tried {{request.get_full_path}} but this is not working with me. Any solution? -- 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@googlegroup

Re: 2 settings files importing one to the other - problem

2011-11-09 Thread RKumar Its mee
I hope you much have tired with Git repository. When you want to import, click on the project in which you need to import, and you get options. Either through git repository connection settings. Have you tried, it. Though I am new to Django. But I am trying to work from this IDE, so pertaining to I

Re: Editing objects from the admin site isn't working

2011-11-09 Thread Ivo Brodien
Can you see the edits in your DB? Did you write code for the admin of that model yourself ? On Nov 9, 2011, at 17:05, Tim Ogilvie wrote: > I'm running into a problem editing from the admin site. I'm able to > successfully create new objects but edits aren't being saved. There > are no error mes

Re: models.FileField versus forms.FileField

2011-11-09 Thread Ivo Brodien
Hi, well they are different things. models.FileField is used to define a field of a model (usually to store in a DB, metadata in this case) The forms.FileField defines a field in a HTML form which can receive File uploads and then can be used to do sth on the server. I think you will get the

Re: admindocs app - almost, but not, working

2011-11-09 Thread lorin
I hadn't noticed that I refered to the dev docs as opposed to the 1.3 docs. But in looking at the docs more carefully (there are no differences on this page), I do believe I erred: missed a / in the URL conf. Getting that right fixes everything. Thank you for your reply that prompted me to recheck.

Re: best practice

2011-11-09 Thread Marc Aymerich
On Wed, Nov 9, 2011 at 10:32 PM, Marc Aymerich wrote: > On Wed, Nov 9, 2011 at 10:18 PM, mirco fini wrote: >> hello, >> >> I would like to ask you if anyone knows some best practice developing >> webapp with django (e.g. use a lot of simple function (or html pages) >> instead of just a few but fu

Re: best practice

2011-11-09 Thread Marc Aymerich
On Wed, Nov 9, 2011 at 10:18 PM, mirco fini wrote: > hello, > > I would like to ask you if anyone knows some best practice developing > webapp with django (e.g. use a lot of simple function (or html pages) > instead of just a few but full of cases > I can recomend 'Clean code', it is a great book

best practice

2011-11-09 Thread mirco fini
hello, I would like to ask you if anyone knows some best practice developing webapp with django (e.g. use a lot of simple function (or html pages) instead of just a few but full of cases thanks a lot Mirco -- You received this message because you are subscribed to the Google Groups "Django u

Re: formset_factory: "extra" param doesn't work? (Django version 1.2.5)

2011-11-09 Thread Kurtis Mullins
Just wanted to clarify -- returning in a loop is an okay thing to do. It saves you from wasting cycles in a given loop. I suppose you could simply "break" out of it as well. I'm sure that could be a matter of opinion. But glad to hear you fixed your specific problem :) On Wed, Nov 9, 2011 at 4:13

Re: formset_factory: "extra" param doesn't work? (Django version 1.2.5)

2011-11-09 Thread bentzy
Solved. It's not recommended to return while in a loop :-X On Nov 9, 10:30 pm, bentzy wrote: > Hi, > > I'm trying to run the example at documentation about formsets(https:// > docs.djangoproject.com/en/1.2/topics/forms/formsets/) > > It basically works, but the "extra" parameter doesn't: > > Fol

delete a field( many to many)

2011-11-09 Thread jose osuna perez
Hola, bueno les explico mi problema, tengo 1 tabla que tiene el siguiente modelo: class Proyectos(models.Model): titulo=models.CharField(max_length=100) creacion=models.DateField(default=datetime.datetime.now) estado=models.CharField(max_length=30) objetivo=models.TextField(null=Tr

formset_factory: "extra" param doesn't work? (Django version 1.2.5)

2011-11-09 Thread bentzy
Hi, I'm trying to run the example at documentation about formsets(https:// docs.djangoproject.com/en/1.2/topics/forms/formsets/) It basically works, but the "extra" parameter doesn't: Following that example, I wrote: def fs(request): ArticleFormSet = formset_factory(ArticleForm, extra=5 )

ImportError: No module named profiles

2011-11-09 Thread Alfredo Alessandrini
Hi, I'm running a script to make a query with django. I need to run it in crontab. When I run it I get this error: ImportError: No module named profiles I'm using a virtualenv. Thanks, Alfredo -- You received this message because you are subscribed to the Google Groups "Django users" gro

User-Based Custom CSS & API

2011-11-09 Thread Kurtis
Hey, I just created a nice little prototype of a custom API Application. This application allows you to set various CSS Selector/Value/ Attributes elements. It also dumps the data (on a per-user basis) to a dynamically generated CSS file. There's going to be quite a bit more features in the future

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
On Wed, Nov 09, 2011 at 04:21:55PM +, Tom Evans wrote: > On Wed, Nov 9, 2011 at 4:03 PM, Niels wrote: > > Worse: > locale.getdefaultlocale() > > (None, None) > > > > Still i'd say this should be handled better than bailing out with an error. > > Something like .. .decode(locale.getdefault

Serializing a model with a pickefield field

2011-11-09 Thread mf
I need to serialize a django model which contains a pickefield. The problem with this is that if I do the following: python manage.py dumpdata myapp --indent=4 > data.json I end up getting a data.json file with the following information in each picklefield field: "picklefield_field": "gA

Re: How can I serve static files while requiring Django-based access permissions?

2011-11-09 Thread zak
Thanks for another great suggestion. My really pressing questions have been successfully answered, I now have a high-performance solution for the final version and a purely Python/Django solution for initial testing and demos. Hopefully I can figure out how to make the high-performance solution wo

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Andre Terra
Love the nl_NL touch Cheers, AT On Wed, Nov 9, 2011 at 2:21 PM, Tom Evans wrote: > On Wed, Nov 9, 2011 at 4:03 PM, Niels wrote: > > Worse: > locale.getdefaultlocale() > > (None, None) > > > > Still i'd say this should be handled better than bailing out with an > error. > > Something like

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Tom Evans
On Wed, Nov 9, 2011 at 4:03 PM, Niels wrote: > Worse: locale.getdefaultlocale() > (None, None) > > Still i'd say this should be handled better than bailing out with an error. > Something like .. .decode(locale.getdefaultlocale()[1] or 'ascii', 'ignore') > You simply need to set an appropriat

Re: Redirect to another page

2011-11-09 Thread vladik_KBR
Thank you very much! -- 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, send email to django-users+unsubscr...@googlegroups.com. For more options,

Deploying Django with Chef

2011-11-09 Thread Adam Nelson
All, We just put out a new blog post on how to use Chef to deploy a Django environment on Amazon ec2 (although any remote Python deployment will benefit from the article, not just Django): http://tech.yipit.com/2011/11/09/how-yipit-deploys-django/ Cheers, Adam -- You received this message be

Editing objects from the admin site isn't working

2011-11-09 Thread Tim Ogilvie
I'm running into a problem editing from the admin site. I'm able to successfully create new objects but edits aren't being saved. There are no error messages given - it looks like the changes were successful but those changes aren't "taking". I've seen some chatter that suggests it may relate to t

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
On Wed, Nov 09, 2011 at 03:38:23PM +, Tom Evans wrote: > On Wed, Nov 9, 2011 at 3:24 PM, Niels wrote: > > Is this a known bug? > > > > csh .. > python manage.py syncdb > > > > Creating tables ... > > Creating table auth_permission > >    default_username = get_system_username() > >  File > >

Re: Best UI for Django

2011-11-09 Thread Nikhil Verma
Just install jquery libraries as we do in other frameworks and give the path of on the page where you want to apply the jquery.Use its functions tools whatever .You can use ajax in similar way.Everything is same .You just need to do this in your templates/.html files I am giving you an example {%

Re: initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Tom Evans
On Wed, Nov 9, 2011 at 3:24 PM, Niels wrote: > Is this a known bug? > > csh .. > python manage.py syncdb > > Creating tables ... > Creating table auth_permission > Creating table auth_group_permissions > Creating table auth_group > Creating table auth_user_user_permissions > Creating table auth_us

Best UI for Django

2011-11-09 Thread Ganesh Kumar
Hi guys, I am beginner of django, I have creating application using django. How integrate with jquery with django, please share your thoughts. please guide me. -Ganesh. Did I learn something today? If not, I wasted it. -- You received this message because you are subscribed to the Google Groups

override ModelChoiceField attribute queryset ( Tablename.objects.none() )

2011-11-09 Thread Nikhil Verma
Hi , I am a newbie in django and come across this problem Description :- I have a ModelForm which contain a field class VisitSetupForm(Form): list_visit_ids = ModelChoiceField(queryset=Visit.objects.none(), empty_label='Select Revisit ID',required=False) Now in the server i want not to load all t

initial database sync throws TypeError in createsuperuser

2011-11-09 Thread Niels
Is this a known bug? csh .. > python manage.py syncdb Creating tables ... Creating table auth_permission Creating table auth_group_permissions Creating table auth_group Creating table auth_user_user_permissions Creating table auth_user_groups Creating table auth_user Creating table django_content

Re: Redirect to another page

2011-11-09 Thread Ivelin Slavov
Hi, first of all, your url patterns should look more like this: url(r'^main$','sample2_app.views.main', name="main"), *remove trailing slash *remove file extension *add a name to this url in the template, instead of trying to access your views directly like "main.html", try using the url templat

Re: Redirect to another page

2011-11-09 Thread Tom Evans
On Wed, Nov 9, 2011 at 12:53 PM, vladik_KBR wrote: > Hi, I've only started to study the Python and web-programming as well. > I need to code a simple web-application with several pages to switch > between, but I don't know a proper way to redirect. How it could be > done using the Django? Return

Redirect to another page

2011-11-09 Thread vladik_KBR
Hi, I've only started to study the Python and web-programming as well. I need to code a simple web-application with several pages to switch between, but I don't know a proper way to redirect. How it could be done using the Django? Here is my code, wich doesn't work proper views.py from django.tem

Re: Filtering generic relation with additional field

2011-11-09 Thread Anthony Musaluke
Almost like that, except lets say you had a field you wanted to use as a list box but its contents depend on what you select in another field. Meaning, you want to use the results of a database query to populate it so you can select an item from the results. Not sure if my explanation is making sen

initial data to Formset causing problem

2011-11-09 Thread Asif Jamadar
I'm assigning initial data to the field of each formset dynamically. But when I'm trying to save that initial data it's throwing "Key Error" in cleaned data. Any solution? Here is the code: In views.py for form in formset.forms: question = form.save(commit=Fal

Re: Filtering generic relation with additional field

2011-11-09 Thread kenneth gonsalves
On Wed, 2011-11-09 at 13:41 +0200, Anthony Musaluke wrote: > I a new to django but have been following the tutorial. I have a > question on your answer: Which file would you place this code in if > you wanted to have that filtering visible in the site admin interface. > Would you need to create a c

Re: Filtering generic relation with additional field

2011-11-09 Thread Anthony Musaluke
Hi Michal I a new to django but have been following the tutorial. I have a question on your answer: Which file would you place this code in if you wanted to have that filtering visible in the site admin interface. Would you need to create a custom selection field from which you can pick to populat

Re: Addng extra variable to request sent by self.client.get() when using django TestCase

2011-11-09 Thread Flavia Missi
TemplateResponsehas the attributes you need, plus, the template rendering process is lazy. I always use this class instead of using HttpResponse directly. []'s On Wed, Nov 9, 2011 at 5:47 AM, nav wrote: > Tha

Re: How can I serve static files while requiring Django-based access permissions?

2011-11-09 Thread Tom Evans
On Tue, Nov 8, 2011 at 11:12 PM, zak wrote: > Thank you, that is a very helpful suggestion. > > However, I have a followup question. What are my options if: > > 1. It is okay to be slow (low performance), and > 2. The method must work on any webserver, not necessarily or > specifically Apache or N

Re: Changes to default project layout?

2011-11-09 Thread Russell Keith-Magee
Hi Victor, All the answers you're looking for are in the draft release notes for the 1.4 release: https://docs.djangoproject.com/en/dev/releases/1.4/#updated-default-project-layout-and-manage-py Yours, Russ Magee %-) On Wed, Nov 9, 2011 at 2:17 PM, Victor Hooi wrote: > heya, > > Also, I notice

Re: Filtering generic relation with additional field

2011-11-09 Thread Michal Petrucha
On Fri, Nov 04, 2011 at 11:03:35AM -0700, guardbadger wrote: > Hi all, > > Appreciate some help trying to build a queryset. Im hoping I can make > this in django, without having to crack open raw sql... Here is my > setup: > > class Container(models.Model): > permissions = generic.GenericRelati

django-grappelli can't embed video?

2011-11-09 Thread mongoose
I installed django-filebrowser==3.3.0 and django-grappelli==2.3.4 onto a simple demo project on django==1.3.1 that only has Flatpages. I've uploaded a a sample .avi into the filebrowser. Added TinyMCE to my flatpages. I click "Insert/edit embedded media", browse to my video and click "Select". The

Re: change Django administration name

2011-11-09 Thread Nicolas
Ok, thanks, it works. I tried different paths but not the one without "admin" at the end, while the doc is clear about that... Anyway! Thank you. Best On Nov 8, 5:56 pm, Tom Evans wrote: > On Tue, Nov 8, 2011 at 4:46 PM, Nicolas wrote: > > Dear all, > > I'm almost at the end of the tutorial par