Re: Inserting csrf-token in a form generated by a templatetag?

2011-05-08 Thread Michal Petrucha
On Sun, May 08, 2011 at 10:13:23PM +0200, Thomas Weholt wrote: > I've got a templatetag generating a form, but trying to add a > csrf-token failes. What's the correct way to add a csrf-token to a > form generated in plain html in a templatetag? Basically, inside the template tag you'll have to reso

Re: filter in python

2011-05-08 Thread Jani Tiainen
On Sun, 2011-05-08 at 09:59 -0700, pankaj sharma wrote: > hello .. > > > i am having a database of college which have a name city state > branches etc... > so > > class College(models.Model): > >name = models.CharField(max_length=250) > >city = models.ForeignKey(City) > >branch1

Re: Loading initial data with a post_syncdb hook?

2011-05-08 Thread Adam Seering
On May 8, 10:53 pm, Karen Tracey wrote: > On Sun, May 8, 2011 at 10:13 PM, Adam Seering wrote: > > (Incidentally, sorry if this is a duplicate; my original reply, > > identical text, doesn't show up on groups.google.com...) > > I don't know why, but google groups decided your original message m

Re: Loading initial data with a post_syncdb hook?

2011-05-08 Thread Karen Tracey
On Sun, May 8, 2011 at 10:13 PM, Adam Seering wrote: > (Incidentally, sorry if this is a duplicate; my original reply, > identical text, doesn't show up on groups.google.com...) > I don't know why, but google groups decided your original message might be spam so held it. When it makes that decis

Re: Loading initial data with a post_syncdb hook?

2011-05-08 Thread Adam Seering
On May 8, 7:16 pm, Jacob Kaplan-Moss wrote: > On Sun, May 8, 2011 at 4:25 PM, Adam Seering wrote: > > I have some Python code that generatesinitialdatafor some of my tables; I > > currently call that code from a post_syncdb hook. In Django 1.3, it looks > > like > > Django now calls TRUNCATE (

Re: Instantiate a model using a string (or a dict)??

2011-05-08 Thread Eiji Kobayashi
Wow. Thank you all so much, esp. sensei Oleg! Eiji On Sun, May 8, 2011 at 10:11 AM, Oleg Lomaka wrote: > To extend Shawn's answer on your example :) > > params = {'username': 'admin', 'email': 'x...@xyz.com', 'password': > 'xyz123'} > # then > new_user = User(**params) > new_user.save() > # or

Re: Problem in Configuring the database

2011-05-08 Thread Malcolm Box
On 7 May 2011 16:44, rahul raj wrote: > After this i wanted to install database.. as mentioned in documentation, i > did install mysql using YaST in OpenSUSE.. when i typed "mysql" in terminal > it showed an error -- " Can't connect to local > MySQL server through socket '/var/run/mysql/mysql.so

Re: Loading initial data with a post_syncdb hook?

2011-05-08 Thread Jacob Kaplan-Moss
On Sun, May 8, 2011 at 4:25 PM, Adam Seering wrote: > I have some Python code that generates initial data for some of my tables; I > currently call that code from a post_syncdb hook. In Django 1.3, it looks like > Django now calls TRUNCATE (or an equivalent non-PostgreSQL-ism) on all tables > afte

Re: curl pages behind login_required

2011-05-08 Thread Jacob Kaplan-Moss
On Sun, May 8, 2011 at 3:17 PM, CarlFK wrote: > I am trying to curl pages that require being logged in via django's > default auth.  I don't care if the actual login is done with curl, > python, firefox or whatever is easiest. Are you wedded to curl for the download? If it were me, I'd use someth

Loading initial data with a post_syncdb hook?

2011-05-08 Thread Adam Seering
Hi, I have some Python code that generates initial data for some of my tables; I currently call that code from a post_syncdb hook. In Django 1.3, it looks like Django now calls TRUNCATE (or an equivalent non-PostgreSQL-ism) on all tables after running syncdb and all of its post- hooks.

Re: curl pages behind login_required

2011-05-08 Thread Shawn Milochik
And just to be clear, I wasn't saying go away. I think you can authenticate completely in curl. If not you can in wget. -- 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 unsubs

Re: curl pages behind login_required

2011-05-08 Thread Shawn Milochik
Do a Google search on using cookies in curl. On May 8, 2011 4:17 PM, "CarlFK" wrote: > I am trying to curl pages that require being logged in via django's > default auth. I don't care if the actual login is done with curl, > python, firefox or whatever is easiest. > > This only works sometimes, so

Re: Django filefield

2011-05-08 Thread pankaj sharma
http://docs.djangoproject.com/en/dev/ref/models/fields/ may be this can help u. Regards: Pankaj On May 8, 1:32 pm, Pulkit Mehrotra wrote: > I want to create a system by which i can upload files to my database .This > database will be a set of question papers .These question papers can be > down

Django filefield

2011-05-08 Thread Pulkit Mehrotra
I want to create a system by which i can upload files to my database .This database will be a set of question papers .These question papers can be downloaded by students for their own use and evaluation.How to create it .What is the use of django filefield.Please provide any links for it . than

curl pages behind login_required

2011-05-08 Thread CarlFK
I am trying to curl pages that require being logged in via django's default auth. I don't care if the actual login is done with curl, python, firefox or whatever is easiest. This only works sometimes, so I am missing something: install https://addons.mozilla.org/en-us/firefox/addon/export-cookie

Inserting csrf-token in a form generated by a templatetag?

2011-05-08 Thread Thomas Weholt
I've got a templatetag generating a form, but trying to add a csrf-token failes. What's the correct way to add a csrf-token to a form generated in plain html in a templatetag? -- Mvh/Best regards, Thomas Weholt http://www.weholt.org -- You received this message because you are subscribed to the

Re: ajax select box

2011-05-08 Thread Ogi Vranesic
Hallo You can use Dajax(ice) to solve your issue. First Dajax and Dajaxice must be installed. In your select box for countries add event 'onchange' i.e.: onchange="Dajaxice.ajax.getCitiesByCountry('Dajax.process', {'name':this.name, 'value':this.value})"> According to this example you must have

Re: filter in python

2011-05-08 Thread pankaj sharma
can i do it without using haystak actually i just want to add one more filter .. On May 8, 11:18 am, Amanjeev Sethi wrote: > Is it possible for you to use Django Haystack for search? > > http://haystacksearch.org/ -- You received this message because you are subscribed to the Google Groups "Dj

Re: Djangodomain hosting

2011-05-08 Thread Amanjeev Sethi
On Sun, May 8, 2011 at 6:55 AM, Daniel de la Cuesta wrote: > and they don't responde to any > support ticket. > Boy! that is bad. At least they should respond with something. -- AJ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: filter in python

2011-05-08 Thread Amanjeev Sethi
Is it possible for you to use Django Haystack for search? http://haystacksearch.org/ -- 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

Re: Instantiate a model using a string (or a dict)??

2011-05-08 Thread Oleg Lomaka
To extend Shawn's answer on your example :) params = {'username': 'admin', 'email': 'x...@xyz.com', 'password': 'xyz123'} # then new_user = User(**params) new_user.save() # or User.objects.create(**params) On Sun, May 8, 2011 at 1:44 PM, Eiji Kobayashi wrote: > Hi! > > Sorry. Another question, p

Re: book count per author for filtered book list

2011-05-08 Thread Oleg Lomaka
I would do this via intermediate model, class Author(models.Model): name = models.CharField(max_length=250) class Book(models.Model): title = models.CharField(max_length=250) author = models.ManyToManyField(Author, through="BookAuthor") class BookAuthor(models.Model): author = mode

Re: Djangodomain hosting

2011-05-08 Thread creecode
Hello Daniel, Sorry no. But I can confirm that the domain (website at least) appears to be down. Toodle-l.. creecode -- 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@googlegrou

filter in python

2011-05-08 Thread pankaj sharma
hello .. i am having a database of college which have a name city state branches etc... so class College(models.Model): name = models.CharField(max_length=250) city = models.ForeignKey(City) branch1 = models.BooleanField(default=False, blank=True) branch2 = models.BooleanField(de

Re: ajax select box

2011-05-08 Thread pankaj sharma
but i dont know about jquery or ajax, can i get any example from any site , can u provide any link which has such code written On May 7, 12:10 pm, Shawn Milochik wrote: > You'll need to write JavaScript. > > Specifically: > >      Write a function that uses AJAX to pass the state to a Django view

Re: Loading project to alwaysdata

2011-05-08 Thread ruler501
I do not understand how ssh works or how to use it. Like I said I don't know much more than the code On May 8, 3:39 am, werefrog wrote: > Hello, > > Does this help you?  http://wiki.alwaysdata.com/wiki/Deploying_a_Django_App > > Regards -- You received this message because you are subscribed to

Re: Loading project to alwaysdata

2011-05-08 Thread ruler501
I do not understand how ssh works or how to use it. Like I said I don't know much more than the code On May 8, 3:39 am, werefrog wrote: > Hello, > > Does this help you?  http://wiki.alwaysdata.com/wiki/Deploying_a_Django_App > > Regards -- You received this message because you are subscribed to

Re: UML to Django - online generation service

2011-05-08 Thread gusheng
yeah...that's useful and...thx :) On 5月8日, 上午2时50分, Javier Guerra Giraldez wrote: > On Sat, May 7, 2011 at 11:21 AM, Juan Hernandez wrote: > > django-extensions does something similar > > second that > > typically i start developing an app by drafting the models. i keep a > window with the outp

Re: Makemessages Multiline

2011-05-08 Thread momo2k
Well, dos2unix solved -- 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,

Re: my models are remembering old fields that I have since deleted

2011-05-08 Thread Leo
I know this probably seems like an orthogonal answer to your question, and also that you're just trying to get something going quickly, but it's really worth setting up South (http://south.aeracode.org/) for any meaningful Django project. Unfortunately, after the fact South can't help you with you

Re: using reverse to find the index-page of an app?

2011-05-08 Thread Karen Tracey
On Sun, May 8, 2011 at 6:42 AM, Thomas Weholt wrote: > I've read > http://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls > , > but cannot for the life of me find a way to use reverse to get the url > of the index page for my app. > > The index page for an app has the url nam

book count per author for filtered book list

2011-05-08 Thread Владислав Максимов
Hi! Short question. I have two models: class Author(models.Model): name = models.CharField(max_length=250) class Book(models.Model): title = models.CharField(max_length=250) author = models.ManyToManyField(Author) One view: def filter_books(request): book_list = Book.objects.

Djangodomain hosting

2011-05-08 Thread Daniel de la Cuesta
Hi, Any body is using DjangoDomain hosting? Their servers are down since yesterday and they don't responde to any support ticket. Any idea? Thank you. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: Instantiate a model using a string (or a dict)??

2011-05-08 Thread Shawn Milochik
You can do it with a dictionary. Just pass it using **kwargs. -- 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+unsubsc

Instantiate a model using a string (or a dict)??

2011-05-08 Thread Eiji Kobayashi
Hi! Sorry. Another question, please. Is it possible to create a model instance using a string parameter? Example, I would like to be able to do something like: param = "username='admin', email='x...@xyz.com', password='xyz123'" new_user = User(param) Of course this won't work. But is there a s

using reverse to find the index-page of an app?

2011-05-08 Thread Thomas Weholt
I've read http://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls, but cannot for the life of me find a way to use reverse to get the url of the index page for my app. Say my app is called "polls" ( for some strange reason ) and I want to redirect to the app_index for that ap

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-08 Thread Eiji Kobayashi
On Sun, May 8, 2011 at 12:00 AM, Oleg Lomaka wrote: > You have started from the beginning. Take a look at my very first reply in > this thread. Remove 'areacode' and 'number' fields from your MemberAdmin. > Let them be available from PhoneInline and AddressInline. You will be see > them on the sa

Django on FreeHostingCloud.com

2011-05-08 Thread Ryan Osborn
I recently came across FreeHostingCloud.com and wanted to see if it is possible to deploy django on it since it provides unlimited bandwidth, disk space and databases and also allows the use of python through fastcgi. I have been following the guide in the documentation here: http://docs.djangop

Re: Django Bigener

2011-05-08 Thread Anish Chapagain
Hi there, do find the ebook "sama django in 24 hr" this is what i have gone through, it looks simple and easy..then you can move to ecommerce platform. for any help,work be in touch. regard's anish On Sun, May 8, 2011 at 12:58 AM, hersh wrote: > Hi to all, > > I am new. I want to apply Django

Re: Loading project to alwaysdata

2011-05-08 Thread werefrog
Hello, Does this help you? http://wiki.alwaysdata.com/wiki/Deploying_a_Django_App Regards -- 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

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-08 Thread Oleg Lomaka
You have started from the beginning. Take a look at my very first reply in this thread. Remove 'areacode' and 'number' fields from your MemberAdmin. Let them be available from PhoneInline and AddressInline. You will be see them on the same admin page, just in other visual block where inline forms d