Re: problem with inserting data through sqlite manually.

2013-05-11 Thread Pradeep Kumar
Hi Anvesh, I didn't understand how you were trying to insert into the tables. Probably your sql code would have helped us hitting on the nail of the problem but anyways let me give you general answers: a) If id field is auto in the database one doesn't need to mention or enter it explicitly while

Re: SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
To try and find more information, I erased the Django-created tables and re-ran syncdb again. This time, I turned verbosity on to 3 and piped all of my stdout to a text file. I actually did this first. However, here's the contents of the first one which includes everything up to the point of fa

Re: SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
I should mention that I *did* convert all of my existing tables to InnoDB which hasn't helped at all. I don't have any weird configuration in my settings.py dealing with the database. As far as I can tell, all new tables created by syncdb are also InnoDB. -- You received this message because y

SyncDB w/ MySQL - Has anyone seen an error like this?

2013-05-11 Thread Kurtis
When running syncdb, I am getting an unusual error. I'm using Django 1.5.1 and a relatively recent version of MariaDB on Arch. I am using some pre-existing tables which I've built Models around. The error is: *DatabaseError: (1005, "Can't create table '.#sql-1e51_2be' (errno: 150)")* Running sy

Re: HttpResponse.has_header

2013-05-11 Thread Larry Martell
On Sat, May 11, 2013 at 9:08 AM, Masklinn wrote: > > On 2013-05-11, at 17:01 , Larry Martell wrote: > >> On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >>> On 2013-05-11, at 15:57 , Larry Martell wrote: Yes, that is what I did. This is not in my urlconf. It's in a view function.

Can I use Connector/Python instead of MySQLdb? And how?

2013-05-11 Thread icedream91
I am using Python 3.3.1 and Django 1.5.1. MySQLdb doesn't support Python 3, so I want to use Connector/Python instead. But I don't know how to do this. Is it easy to do this? If it is, how can I do this? Thanks. -- You received this message because you are subscribed to the Google Groups "Dja

Re: Trying to figure out ManyToManyField on a legacy database

2013-05-11 Thread brian
Thanks Kevin, that did the trick. This is going to be an interesting project. There are 3 different database types with DJ's song info involved. Each DJ has their private database. Can I have different models, and have a way to link the different DJ's databases to the correct model for their da

Re: Trying to figure out ManyToManyField on a legacy database

2013-05-11 Thread kevin
Hi Brian, It seems like you don't really have an Many To Many relationship between your "Song" and "Played" objects. I can see how you would have multiple plays for one song, but considering that the Played model has a track_id, would you ever have multiple songs for a single Play?It appea

Re: NoReverseMatch at /accounts/login/ Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.

2013-05-11 Thread Hu Shizhi
Thanks Raharu. It works. Best, Tian On Saturday, May 11, 2013 10:12:37 PM UTC+8, Raharu Haruha wrote: > > there is no pattern named "index" (name="index") so, no reverse match > also, if you planned to work with django in future, i suggest you to use > new-style url template tag like so: > > {%

Trying to figure out ManyToManyField on a legacy database

2013-05-11 Thread Brian Millham
Hi all, I'm just trying to learn Django. I have an existing site that I wrote in PHP, and I'l considering converting it to Django, I have a legacy database that I don't want to make any changes to. I have the basics working in Django, but am having a problem with a ManyToManyField. Here are th

Re: form validation

2013-05-11 Thread Roberto López López
Problem solved with BaseInlineFormSet.clean() :-) On 05/11/2013 06:56 PM, Roberto López López wrote: > > Hi everyone, > > I need to do some validation in my model. So far, I have been able to > validate normal forms, but I want to validate forms with an inline, to > ensure that at least one of

form validation

2013-05-11 Thread Roberto López López
Hi everyone, I need to do some validation in my model. So far, I have been able to validate normal forms, but I want to validate forms with an inline, to ensure that at least one of those inlines match the requirement. My code: class PDMAdminForm(ModelForm): class Meta:

Re: HttpResponse.has_header

2013-05-11 Thread Masklinn
On 2013-05-11, at 17:01 , Larry Martell wrote: > On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: >> On 2013-05-11, at 15:57 , Larry Martell wrote: >>> >>> Yes, that is what I did. This is not in my urlconf. It's in a view >>> function. I replaced: >>> >>> return direct_to_template(request, te

Re: HttpResponse.has_header

2013-05-11 Thread Larry Martell
On Sat, May 11, 2013 at 8:23 AM, Masklinn wrote: > On 2013-05-11, at 15:57 , Larry Martell wrote: >> >> Yes, that is what I did. This is not in my urlconf. It's in a view >> function. I replaced: >> >> return direct_to_template(request, template) >> >> by: >> >> return TemplateView.as_view(templat

Re: NoReverseMatch at /accounts/login/ Reverse for 'index' with arguments '()' and keyword arguments '{}' not found.

2013-05-11 Thread Raharu Haruha
there is no pattern named "index" (name="index") so, no reverse match also, if you planned to work with django in future, i suggest you to use new-style url template tag like so: {% load url form future %} ... {% url 'index' %} ... On Saturday, May 11, 2013 5:14:02 AM UTC+4, Hu Shizhi wrote: > >

Re: Accessing django development server using internet

2013-05-11 Thread phil...@bailey.st
On 07/05/13 17:38, Kakar wrote: > I have my project in my pc, and on python manage.py runserver, i can view it > on my browser. But how to view from other computer or on the internet and not > locally?... How to make my pc a server to view it from over the internet? Plz > help me guyz! > I Kak

Invalid block tag with Inclusion Tag

2013-05-11 Thread neil
I am attempting to create a fairly straightforward inclusion tag out of nothing more than a hardcoded dictionary of keywords. My app is set up like this: *apps* * keywords* *templatetags* *__init__.py* *popular_keyword_tags.py* *__init__.py* * __init__.py* I have inclu

Re: HttpResponse.has_header

2013-05-11 Thread Masklinn
On 2013-05-11, at 15:57 , Larry Martell wrote: > > Yes, that is what I did. This is not in my urlconf. It's in a view > function. I replaced: > > return direct_to_template(request, template) > > by: > > return TemplateView.as_view(template_name=template) > > Is that not correct? Indeed not, `

Re: HttpResponse.has_header

2013-05-11 Thread Larry Martell
On Sat, May 11, 2013 at 7:30 AM, Masklinn wrote: > On 2013-05-11, at 15:08 , Larry Martell wrote: >> On Fri, May 10, 2013 at 2:13 PM, Larry Martell >> wrote: >>> On Fri, May 10, 2013 at 9:37 AM, Larry Martell >>> wrote: On Fri, May 10, 2013 at 8:55 AM, Tom Evans wrote: > On Fri

Re: HttpResponse.has_header

2013-05-11 Thread Masklinn
On 2013-05-11, at 15:08 , Larry Martell wrote: > On Fri, May 10, 2013 at 2:13 PM, Larry Martell > wrote: >> On Fri, May 10, 2013 at 9:37 AM, Larry Martell >> wrote: >>> On Fri, May 10, 2013 at 8:55 AM, Tom Evans wrote: On Fri, May 10, 2013 at 2:52 PM, Larry Martell wrote: > Jus

Re: HttpResponse.has_header

2013-05-11 Thread Larry Martell
On Fri, May 10, 2013 at 2:13 PM, Larry Martell wrote: > On Fri, May 10, 2013 at 9:37 AM, Larry Martell > wrote: >> On Fri, May 10, 2013 at 8:55 AM, Tom Evans wrote: >>> On Fri, May 10, 2013 at 2:52 PM, Larry Martell >>> wrote: Just upgraded to 1.5 and my app is failing with: In

Re: Is unique_together case-insensitive ?

2013-05-11 Thread Parin Porecha
Got it Thanks! On Sat, May 11, 2013 at 1:42 PM, Joey Chang wrote: > You can'n change it via django directly. > https://docs.djangoproject.com/en/1.5/ref/databases/#collation-settings > this link is django collation-settings notes. > and > http://dev.mysql.com/doc/refman/5.0/en/charset-column.ht

Re: Is unique_together case-insensitive ?

2013-05-11 Thread Joey Chang
You can'n change it via django directly. https://docs.djangoproject.com/en/1.5/ref/databases/#collation-settings this link is django collation-settings notes. and http://dev.mysql.com/doc/refman/5.0/en/charset-column.html this shows how to change the collation in mysql. 2013/5/11 Parin Porecha

Re: Is unique_together case-insensitive ?

2013-05-11 Thread Parin Porecha
Yes, I forgot to mention I am running Django 1.5, with database MySQL So, how can I change the COLLATE pattern through Django's model fields ? If not via Django, can you show me how to change it manually ? On Sat, May 11, 2013 at 1:19 PM, Joey Chang wrote: > What's your database engine? > As i

Re: Is unique_together case-insensitive ?

2013-05-11 Thread Joey Chang
What's your database engine? As i know, if your database engine was mysql, and the database's COLLATE pattern name ends with "_ci" which means case-insensitive. you should got that result. You can change the COLLATE pattern to the name which ends with "_cs" or "_bin". Wish it's useful to you 2

Re: Is unique_together case-insensitive ?

2013-05-11 Thread Parin Porecha
UPDATE: On changing the user, it gets saved successfully. So, the problem is with the object.name I want to save both the objects. How can I do so ? On Sat, May 11, 2013 at 12:48 PM, Parin Porecha wrote: > Hi, > > This is my model - > > class Tag(models.Model): > user = models.ForeignKey(g

Is unique_together case-insensitive ?

2013-05-11 Thread Parin Porecha
Hi, This is my model - class Tag(models.Model): user = models.ForeignKey(get_user_model()) name = models.CharField(max_length = 300) color = models.CharField(max_length = 10) icon = models.CharField(max_length = 50) class Meta: unique_together = ("user", "name")