AW: Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
I think sqlflush just prints the SQL-Statement. Flush will actually du the job Hope that helps ! Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im Auftrag von Chen Xu Gesendet: Dienstag, 15. Februar 2011 08:45 An: django-users@googlegroups.com Betreff: Re:

Re: Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Chen Xu
thanks very much everyone, but I just have one more small question. I tried to use some python manage.py command to delete tables (ex: sqlflush, sqlreset), but they all just print out the sql statement without doing the real job, so what is the command to do the actual removal of the tables?

Re: Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Praveen Krishna R
*Please try delete and recreate the database and do the syncdb again, * *if you are learning. **If you are in production, use South for django, for the schema migration.* On Tue, Feb 15, 2011 at 10:06 AM, Chen Xu wrote: > Hi, everyone: > I have a question about Django

Re: Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Martin Melin
On Tue, Feb 15, 2011 at 8:06 AM, Chen Xu wrote: > Hi, everyone: > I have a question about Django models, > so I created a Model: > > class Person(models.Model): >     name = models.CharField(max_length=60) > >     and ran the follwing: > >    python manage.py syncdb > >   this

Having trouble synchronizing the database, can someone help?

2011-02-14 Thread Chen Xu
Hi, everyone: I have a question about Django models, so I created a Model: class Person(models.Model): name = models.CharField(max_length=60) and ran the follwing: python manage.py syncdb this successfully did what I want, but later on, I added a new field into a model class

RE: Django Form Doesn't Render

2011-02-14 Thread Chris Matthews
Hi Dean, Looks like you pass the class ContractForm in to your render (and not the variable contractForm). Also on naming (PEP 8) contract_form would have been nicer for the variable (and would have stood out more so that the error was easier to spot). Regards Chris -Original

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
On Mon, Feb 14, 2011 at 9:53 PM, Bobby Roberts wrote: > yeah i've got it where session ends on browser close so they will > refresh when they come back and log back in.  I'm just trying to find > an efficient way to store the values so that I don't have to query on > every

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
yeah i've got it where session ends on browser close so they will refresh when they come back and log back in. I'm just trying to find an efficient way to store the values so that I don't have to query on every page. On Feb 14, 9:19 pm, Shawn Milochik wrote: > Pickling will

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
someone can choose 1 or many locations in their profile and i'm trying to think of an interesting way to put those values from the MTM table into a session var. On Feb 14, 9:03 pm, Bobby Roberts wrote: > just wanted to clarify... i've got the manytomany setup in a user >

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
Pickling will let you store objects as strings. However, perhaps you would like to use a memoize[1] decorator on your function. Are you trying to do this for performance reasons, because getting that relationship info from the database is slow? Regardless of why you're doing it, make sure you

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Shawn Milochik
You can always use pickle to serialize something. What do you mean by a "many to many relationship," though? -- 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

Re: trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
just wanted to clarify... i've got the manytomany setup in a user profile. When they login i'm loading certain pieces of their profile into session variables. One of these fields is the MTM and the data is stored outside of the userprofile model in the MTM table... how would I go about taking

trouble storing a manytomany field in a session variable

2011-02-14 Thread Bobby Roberts
I'm trying to figure out how to store a manytomany relationship in a session variable. is the only way really to do it to loop through and make a csv string and save that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Writing a DB backend

2011-02-14 Thread Russell Keith-Magee
On Tue, Feb 15, 2011 at 2:47 AM, John Finlay wrote: > I am working on a app that keeps information in a non-SQL database composed > of XML files referenced as UUIDs. In the prototype I'm directly referencing > these using a simple api. For the production version I'm wondering

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
Thanks. I'll look into them. On Feb 14, 1:55 pm, Xavier Ordoquy wrote: > Hi > > You have several options depending on what you're ready to do. > > 1) Drop the database, recreate it and resync it (fine as long as you don't > have data to keep) > 2) Install django command

Django Form Doesn't Render

2011-02-14 Thread Dean Chester
Hi, I have written a form in forms.py that looks like this: class ContractForm(forms.Form): title = forms.CharField() start_date = forms.DateField() end_date = forms.DateField() description = forms.CharField(widget=forms.Textarea) client =

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread Xavier Ordoquy
Hi You have several options depending on what you're ready to do. 1) Drop the database, recreate it and resync it (fine as long as you don't have data to keep) 2) Install django command extension (http://code.google.com/p/django-command-extensions/) and take sqldiff output to modify your DB

Writing a DB backend

2011-02-14 Thread John Finlay
I am working on a app that keeps information in a non-SQL database composed of XML files referenced as UUIDs. In the prototype I'm directly referencing these using a simple api. For the production version I'm wondering if it would be possible to build a db backend that would allow me to use

Re: Django Templates: Form field name as variable?

2011-02-14 Thread Mike Ramirez
On Monday, February 14, 2011 07:00:38 am ju wrote: > How can I make this loop to print form fields where is the > value of ticket.id? > > {% for ticket in zone.tickets %} > {{ ticket.id }}: {{ form.ticket_count_ }} > {% endfor %} > > So the output to be something like

Re: Google App Engine supports Django 1.2!

2011-02-14 Thread Gath
Please give me a pointer/link to a tutorial on how i can use GAE with django. Thanks, Gath. On Feb 14, 7:12 am, Sarang wrote: > Thanks for the clarification. Yes, I am using django-nonrel which installed > 1.3.0 alpha 1 for me. > > Regards, > Sarang -- You received

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
I think you're right. So how do I update the table manually, or maybe a better question is how do I completely delete it and then put it back the way I need to have? Can you point me to somewhere in the documenation for where to find this, or can you give me a step by step process for how to keep

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread Mike Ramirez
On Monday, February 14, 2011 09:25:58 am Tom Evans wrote: > Django does not take care of maintaining the structure of your tables. > If you change your model definition to add a new attribute, django > will not update your database to add the new column to your table, you > must do it manually. >

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread Tom Evans
On Mon, Feb 14, 2011 at 5:34 PM, hank23 wrote: > OK. I will change it to an EmailField and see if that helps. However I > have a further question. When making changes like this to existing > tables, do I always need to run the syncdb command to make sure that > everything

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread Tom Evans
On Mon, Feb 14, 2011 at 5:28 PM, wrote: > Tom, > > How does he do that? > Sent from my BlackBerry wireless device from MTN > Follow the instructions in the fine manual for the chosen DB engine. For example, in MySQL, you would do something like this: > $ python

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
OK. I will change it to an EmailField and see if that helps. However I have a further question. When making changes like this to existing tables, do I always need to run the syncdb command to make sure that everything is updated properly then? On Feb 14, 11:28 am, delegb...@dudupay.com wrote: >

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread delegbede
Tom, How does he do that? Sent from my BlackBerry wireless device from MTN -Original Message- From: Tom Evans Sender: django-users@googlegroups.com Date: Mon, 14 Feb 2011 17:25:58 To: Reply-To: django-users@googlegroups.com

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread delegbede
I'm not so sure about this but I feel you are not declaring the email field properly. That however may not be the problem, others would sure come with help. Instead of declaring it as models.CharField, I think it should be models.EmailField. Please check the django documentation for more

Re: Model Codng/Model Usage Pitfall?

2011-02-14 Thread Tom Evans
On Mon, Feb 14, 2011 at 5:21 PM, hank23 wrote: > I have coded a table which looks like this: > > class Comment(models.Model): >    title = models.CharField(max_length=1,choices=TITLE_CHOICES) >    firstname = models.CharField(max_length=15) >    lastname =

Model Codng/Model Usage Pitfall?

2011-02-14 Thread hank23
I have coded a table which looks like this: class Comment(models.Model): title = models.CharField(max_length=1,choices=TITLE_CHOICES) firstname = models.CharField(max_length=15) lastname = models.CharField(max_length=25) commenttext = models.CharField(max_length=500)

Re: KeyError at /save/ 'tags'

2011-02-14 Thread Corden Naraga - Davao City, Philippines
Ya, that line causes the error - tag_names = form.cleaned_data['tags'].split() On Feb 15, 12:28 am, David De La Harpe Golden wrote: > On 14/02/11 13:58, corden wrote: > > >             tag_names = form.cleaned_data['tags'].split() > > ^^^ tags > > >     tag =

Re: KeyError at /save/ 'tags'

2011-02-14 Thread David De La Harpe Golden
On 14/02/11 13:58, corden wrote: > tag_names = form.cleaned_data['tags'].split() ^^^ tags > tag = forms.CharField(label=u'Tags', required=False, ^^^ tag ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

KeyError at /save/ 'tags'

2011-02-14 Thread corden
Here's the code views.py -- def bookmark_save_page(request): if request.method == 'POST': form =

Django Templates: Form field name as variable?

2011-02-14 Thread ju
How can I make this loop to print form fields where is the value of ticket.id? {% for ticket in zone.tickets %} {{ ticket.id }}: {{ form.ticket_count_ }} {% endfor %} So the output to be something like this... 1: 10: 12: 3: -- You received this message because you are

Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-14 Thread hank23
Are there any exampels of how to code Progress bars or the handlers which support them somewhere in the django documentation? they're referenced in the documentation, but without showing any actual coding examples. -- You received this message because you are subscribed to the Google Groups

Re: Login, Password Recovery, etc

2011-02-14 Thread Andre Terra
Is it just me or there aren't any downloads available for these projects? I'm behind a firewall and can't really try cloning from git. Thanks in advance for the help Sincerely, Andre Terra On Sun, Feb 13, 2011 at 7:40 PM, indymike wrote: > Andres - > > Thank you. This

AW: AW: Form to add data

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
okay your first linked helped me...thank you ! I guess the documentaion is just too fragmented for me. So now my view looks like this: def main(request): f = BuchungForm(request.POST) return render_to_response('main/index.html', {'user' : request.user, 'form' : f}) and my template

Re: AW: Form to add data

2011-02-14 Thread Tom Evans
On Mon, Feb 14, 2011 at 1:19 PM, Szabo, Patrick (LNG-VIE) wrote: > I swear I'm reading the documentaion but i really can't find those > information. How hard are you looking? http://docs.djangoproject.com/en/1.2/topics/forms/ This page shows a clear example of how

AW: AW: Form to add data

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Ahh stupid mistake...okay no error anymore. But i still dont see any field in my view :-( How do show the form ?! I guess i have to pass the form onto the template and then reference to it in the template ?! If so, how do I do that ?! I swear I'm reading the documentaion but i really can't

Re: AW: Form to add data

2011-02-14 Thread Michael
You have to import AuthorForm into your views.py from models import AuthorForm -- Michael On Mon, 2011-02-14 at 13:53 +0100, Szabo, Patrick (LNG-VIE) wrote: > Thanks, that is exactly what I've been reading for the past hours but i can't > make it work. > > >From what i

AW: Form to add data

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Thanks, that is exactly what I've been reading for the past hours but i can't make it work. >From what i understand: I do this in my models.py class AuthorForm(ModelForm): class Meta: model = Author Where do i have to put this to f = AuthorForm(request.POST) ?! My guess was in

Re: Form to add data

2011-02-14 Thread Daniel Roseman
On Monday, February 14, 2011 12:42:48 PM UTC, Szabo, Patrick (LNG-VIE) wrote: > > Hi, > > How do i add a form to a template/view that let’s me add a Databaseentry. > > I also want to list all the entries from a certain table in on the same > site. > > Now I’m reading the documentaion and it

Form to add data

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Hi, How do i add a form to a template/view that let's me add a Databaseentry. I also want to list all the entries from a certain table in on the same site. Now I'm reading the documentaion and it says something about automaticly creating such forms from models but i can't figure out

AW: change password

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Never mind...figured it out ;-) . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Szabo XSLT-Entwickler LexisNexis Marxergasse 25, 1030 Wien mailto:patrick.sz...@lexisnexis.at Tel.: +43 (1) 534 52 - 1573 Fax: +43 (1) 534 52 - 146 -Ursprüngliche Nachricht- Von:

change password

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Hi, I know i ask a lot of questions but I have to relaize this project in almost no time and i just startet using django. I want to give users the possibility to change their passwords. I have to use my own template but i cant figure out how to do that. For testing i just copied the

Re: Newbie Question

2011-02-14 Thread Kenneth Gonsalves
On Mon, 2011-02-14 at 02:14 -0800, zedkil wrote: > Thank you very much for your kind explanations. > > Another question on the admin UI, can I customize the user page in the > admin > gui and add him some capabilities do some actions like get statistics > see > some graph and so on, and do this

Re: Newbie Question

2011-02-14 Thread zedkil
Thank you very much for your kind explanations. Another question on the admin UI, can I customize the user page in the admin gui and add him some capabilities do some actions like get statistics see some graph and so on, and do this customization per level, or this is out of scope for the

AW: login-required

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
I've already read those papers, but it still helped...it works now ;-) Thanks a lot ! Kind regards . . . . . . . . . . . . . . . . . . . . . . . . . . Patrick Szabo XSLT-Entwickler LexisNexis Marxergasse 25, 1030 Wien mailto:patrick.sz...@lexisnexis.at Tel.: +43 (1) 534 52 - 1573 Fax: +43

Re: login-required

2011-02-14 Thread Martin Melin
On Mon, Feb 14, 2011 at 9:40 AM, Szabo, Patrick (LNG-VIE) wrote: > Hi, > > I've tried using the @login_required decorator to limit acces to a > certain view. > This worked fine. > Unfortunately in the template that you are redirected to if the login > was succesfull I

login-required

2011-02-14 Thread Szabo, Patrick (LNG-VIE)
Hi, I've tried using the @login_required decorator to limit acces to a certain view. This worked fine. Unfortunately in the template that you are redirected to if the login was succesfull I don't have acces to any information like username oder alike. How do I realize that ?! For the login

Re: Queryset cloning is very expensive

2011-02-14 Thread myx
Thank you for the reply. But I meant a slightly different case: Item.objects.filter(...).order_by(...).values_list('id', flat=True)[: 10] As you can see, there are four cloning operations. Wouldn't be chaining possible without cloning the queryset? The method could just return the original