Re: connection to an existing legacy database

2021-07-21 Thread Gabriel Araya Garcia
Get the [ODBC Driver in other site, perhaps your odbc driver are corrupted. Gabriel Araya Garcia GMI - Desarrollo de Sistemas Informáticos El lun, 19 jul 2021 a las 19:58, sum abiut () escribió: > I am trying to connect Django to an existing legacy database but I got > this error mess

Re: connection to an existing legacy database

2021-07-20 Thread sum abiut
sum abiut wrote: > >> I am trying to connect Django to an existing legacy database but I got >> this error message. I only get the message why I try to migrate. I follow >> the guide from the Django documentation >> <https://docs.djangoproject.com/en/3.2/how

Re: connection to an existing legacy database

2021-07-20 Thread Divyesh Khamele
If you have any doubt I’ll provide you all the solutions (Dm for paid work) On Tue, 20 Jul 2021 at 5:29 AM, sum abiut wrote: > I am trying to connect Django to an existing legacy database but I got > this error message. I only get the message why I try to migrate. I follow > the guide

connection to an existing legacy database

2021-07-19 Thread sum abiut
I am trying to connect Django to an existing legacy database but I got this error message. I only get the message why I try to migrate. I follow the guide from the Django documentation <https://docs.djangoproject.com/en/3.2/howto/legacy-databases/>. error message: django.db.utils.Programmin

Explicitly setting 'created' date for Users when importing from Legacy database

2018-09-24 Thread Chris Routh
Hi folks, I'm wondering if there is a way to override the automatic 'creation' date for a user for an initial import of users from a legacy database, but then use normal created date settings the rest of the time. I imagine I need to override the user model, however I would

Re: UI for a legacy database

2017-05-28 Thread Melvyn Sopacua
On Wednesday 24 May 2017 09:38:08 jorge alarcon wrote: > where as my current view is: > > class IndexView(generic.ListView): > > template_name = "db/index.html" > > paginate_by = 50 > > context_object_name = 'Columns' > > queryset = Columns.objects.all() > > > However, this

UI for a legacy database

2017-05-24 Thread jorge alarcon
Hello everyone, I am working on designing a user interface for a legacy database. Using python manage.py inspectdb I got the following models: class Columnnames(models.Model): id = models.BigAutoField(primary_key=True

Re: Generic Relation in Legacy Database?

2015-03-12 Thread Gergely Polonkai
Hello, By taking a quick glance on I'm afraid that a GFK subclass is your best bet. I was experimenting with a Doctrine DB (based on your description my guess was that your old ORM may be that). A little bit of change to GFK made the query working, although I haven't solved the insert/update probl

Re: Generic Relation in Legacy Database?

2015-03-11 Thread Gergely Polonkai
Hello, sure, I can do that as soon as I get home in the evening (timezone CET). Maybe we can patch up some helper class for anyone who wants to migrate from eloquent, although I don't think many devs who use an ORM already would want to transition to another, but hey, who knows? :) Best, Gergely

Re: Generic Relation in Legacy Database?

2015-03-10 Thread ringemup
Thanks, Gergely — it’s actually Eloquent, which handles GFKs a little more similarly to Django than Doctrine does, AFAICT. Would you mind sharing your GFK changes-in-progress? Maybe we could collaborate on a broader solution. On Mar 10, 2015, at 3:30 PM, Gergely Polonkai wrote: > Hello, >

Re: Generic Relation in Legacy Database?

2015-03-10 Thread ringemup
Avraham, are you at all familiar with Django’s GenericForeignKey model field? It relies on *two* fields in the model. Django resolves a generic foreign key by looking up the content type (a FK to the content types table) to figure out what table to look for the object ID in. Then it looks f

Re: Generic Relation in Legacy Database?

2015-03-10 Thread Avraham Serour
for each field in the model you can specify the column name un the db, it does have a default way of calculating that, but you can specify in any case you can tell the django ORM that this field is not an int, it is actually a foreign key, let me know if that works what DB are you using? mysql?

Re: Generic Relation in Legacy Database?

2015-03-10 Thread Nan
Thanks, Avraham -- I was planning to use inspectdb as a first step, and it's very handy in streamlining building models! But that doesn't even begin to solve the problem of how a GFK modeled differently than Django's ORM does can be used as an actual foreign key. On Sunday, March 8, 2015 at 1

Re: Generic Relation in Legacy Database?

2015-03-08 Thread Avraham Serour
use inspectdb to start On Sun, Mar 8, 2015 at 5:31 PM, Nan wrote: > > Hi folks -- > > I'm building out Django models to represent a legacy PHP app's database in > order to throw together a quick admin panel. Everything's working great > except that the ORM of the other application represents ge

Generic Relation in Legacy Database?

2015-03-08 Thread Nan
Hi folks -- I'm building out Django models to represent a legacy PHP app's database in order to throw together a quick admin panel. Everything's working great except that the ORM of the other application represents generic relations slightly differently than Django's does. I can't modify the

Re: how to test an application that's using a legacy database

2014-11-12 Thread David Palao
2014-11-12 0:25 GMT+01:00 Carl Meyer : > Hi David, > > On 11/11/2014 08:37 AM, dpalao.pyt...@gmail.com wrote: >> Dear Carl, >> >> Thank you for the answer. >> >> On Tuesday, November 11, 2014 3:13:18 PM UTC+1, Carl Meyer wrote: >> >> Hi David, >> >> On 11/11/2014 07:01 AM, dpalao...@gmail.c

Re: how to test an application that's using a legacy database

2014-11-11 Thread Carl Meyer
Hi David, On 11/11/2014 08:37 AM, dpalao.pyt...@gmail.com wrote: > Dear Carl, > > Thank you for the answer. > > On Tuesday, November 11, 2014 3:13:18 PM UTC+1, Carl Meyer wrote: > > Hi David, > > On 11/11/2014 07:01 AM, dpalao...@gmail.com wrote: > > I see your point. You might be

Re: how to test an application that's using a legacy database

2014-11-11 Thread dpalao . python
Dear Carl, Thank you for the answer. On Tuesday, November 11, 2014 3:13:18 PM UTC+1, Carl Meyer wrote: > > Hi David, > > On 11/11/2014 07:01 AM, dpalao...@gmail.com wrote: > > I see your point. You might be right, but it is not clear to me how to > > do it and if it would work: I have already

Re: how to test an application that's using a legacy database

2014-11-11 Thread Carl Meyer
Hi David, On 11/11/2014 07:01 AM, dpalao.pyt...@gmail.com wrote: > I see your point. You might be right, but it is not clear to me how to > do it and if it would work: I have already tried to subclass > DiscoverRunner to modify its behaviour with little success. If there are specific aspects of "

Re: how to test an application that's using a legacy database

2014-11-11 Thread dpalao . python
Dear Carl, I see your point. You might be right, but it is not clear to me how to do it and if it would work: I have already tried to subclass DiscoverRunner to modify its behaviour with little success. Another problem that I see: it is not an homogenous approach. I mean, the models are created

Re: how to test an application that's using a legacy database

2014-11-11 Thread dpalao . python
Dear Fred, Thanks a lot for the answer. Actually I got very happy when I saw it. But I sadly found out that it does not work in my case. I think the problem is related to the way Django-1.7 behaves with respect to databases, migrations and so on. Not 100% sure, though. I don't really know what

Re: how to test an application that's using a legacy database

2014-11-10 Thread Carl Meyer
Hi David, On 11/10/2014 08:14 AM, dpalao.pyt...@gmail.com wrote: > Probably I was not clear in my original post. My problem is precisely > how to switch managed to True just before the tests and put it back to > False afterwards to avoid creating of tables by hand during the tests. > That is preci

Re: how to test an application that's using a legacy database

2014-11-10 Thread Fred Stluka
David, No. You can use it unchanged. With Django 1.4 at least, and I assume also with 1.7. I have a legacy MS SQL Server DB where I have rights to modify data but not tables. I also cannot create new DBs in MS SQL Server. I used *inspectdb* to create models from the existing DB. I generally

Re: how to test an application that's using a legacy database

2014-11-10 Thread dpalao . python
On Monday, November 10, 2014 4:08:15 PM UTC+1, donarb wrote: > > > > On Monday, November 10, 2014 7:00:12 AM UTC-8, dpalao...@gmail.com wrote: >> >> Here comes the context. Sorry. >> >> On Monday, November 10, 2014 3:49:40 PM UTC+1, larry@gmail.com wrote: >>> >>> >>> No, when you run syncdb it

Re: how to test an application that's using a legacy database

2014-11-10 Thread dpalao . python
On Monday, November 10, 2014 4:03:57 PM UTC+1, larry@gmail.com wrote: > > On Mon, Nov 10, 2014 at 10:00 AM, > > wrote: > > Here comes the context. Sorry. > > > > On Monday, November 10, 2014 3:49:40 PM UTC+1, larry@gmail.com > wrote: > >> > >> > >> No, when you run syncdb it will

Re: how to test an application that's using a legacy database

2014-11-10 Thread donarb
On Monday, November 10, 2014 7:00:12 AM UTC-8, dpalao...@gmail.com wrote: > > Here comes the context. Sorry. > > On Monday, November 10, 2014 3:49:40 PM UTC+1, larry@gmail.com wrote: >> >> >> No, when you run syncdb it will not create or modify any existing >> tables, only create new ones.

Re: how to test an application that's using a legacy database

2014-11-10 Thread Larry Martell
On Mon, Nov 10, 2014 at 10:00 AM, wrote: > Here comes the context. Sorry. > > On Monday, November 10, 2014 3:49:40 PM UTC+1, larry@gmail.com wrote: >> >> >> No, when you run syncdb it will not create or modify any existing >> tables, only create new ones. > > > Again, are the docs wrong? Th

Re: how to test an application that's using a legacy database

2014-11-10 Thread dpalao . python
Here comes the context. Sorry. On Monday, November 10, 2014 3:49:40 PM UTC+1, larry@gmail.com wrote: > > > No, when you run syncdb it will not create or modify any existing > tables, only create new ones. > Again, are the docs

Re: how to test an application that's using a legacy database

2014-11-10 Thread Larry Martell
On Mon, Nov 10, 2014 at 9:53 AM, wrote: > So what is written in the docs is wrong? Please provide some context. Quote the relevant portions of the post you're replying to. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: how to test an application that's using a legacy database

2014-11-10 Thread dpalao . python
So what is written in the docs is wrong? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to d

Re: how to test an application that's using a legacy database

2014-11-10 Thread Larry Martell
On Mon, Nov 10, 2014 at 9:43 AM, wrote: > Hi, > I'm writing a Django application that uses an existing database. If I > understood it well, in such a case one must create non-managed models for > the legacy tables to avoid Django creating already existing tables, right? No, when you run syncdb i

how to test an application that's using a legacy database

2014-11-10 Thread dpalao . python
Hi, I'm writing a Django application that uses an existing database. If I understood it well, in such a case one must create non-managed models for the legacy tables to avoid Django creating already existing tables, right? For instance, this is how one of my models looks like: class JobInfo(mode

Re: running unit tests with legacy database: Error 1050, Table already exists

2014-11-07 Thread dpalao . python
> > But I have checked that "managed" is switched to True during the tests. > > Any ideas? > > Thanks in advance, > > David > > 2014-11-05 18:45 GMT+01:00 Collin Anderson : > > Hi David, > > > > Interesting. Shouldn't the test dat

Re: running unit tests with legacy database: Error 1050, Table already exists

2014-11-06 Thread David Palao
line "managed = False" and run makemigrations, the test passes. But I have checked that "managed" is switched to True during the tests. Any ideas? Thanks in advance, David 2014-11-05 18:45 GMT+01:00 Collin Anderson : > Hi David, > > Interesting. Shouldn&#x

Re: running unit tests with legacy database: Error 1050, Table already exists

2014-11-05 Thread Collin Anderson
Hi David, Interesting. Shouldn't the test database be a separate, fresh, empty database (not a legacy database)? Thanks, Collin -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

running unit tests with legacy database: Error 1050, Table already exists

2014-11-04 Thread dpalao . python
Hello, I'm relatively new to Django, so it might well be a silly question... I'm using Django-1.7 with Python-3.3. I'm working with a legacy MySQL database. I tried both pymysql and mysql-connector-python, the errors are similar. When I run the unit tests, for instance, with mysql-connector-pytho

Re: big legacy database with complex many to many relationships

2014-02-24 Thread Tom Evans
On Mon, Feb 24, 2014 at 7:54 PM, Sells, Fred wrote: > I have to integrate to a large read only legacy mssql database . > > > > The many-to-many tables have a lot of additional fields like start/end dates > of the relationship and their own naming conventions > > > > Can anyone point me to some lin

RE: big legacy database with complex many to many relationships

2014-02-24 Thread Sells, Fred
Thanks, I think you set me on the right track. Fred. -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Javier Guerra Giraldez Sent: Monday, February 24, 2014 3:12 PM To: django-users@googlegroups.com Subject: Re: big legacy

Re: big legacy database with complex many to many relationships

2014-02-24 Thread Javier Guerra Giraldez
On Mon, Feb 24, 2014 at 2:54 PM, Sells, Fred wrote: > I have to integrate to a large read only legacy mssql database . while certainly it's possible to configure this as a second database and use the ORM, I've found that it's more work than usually needed. especially if you already have defined

big legacy database with complex many to many relationships

2014-02-24 Thread Sells, Fred
I have to integrate to a large read only legacy mssql database . The many-to-many tables have a lot of additional fields like start/end dates of the relationship and their own naming conventions Can anyone point me to some links that treat this topic in depth. I've looked at the django book an

Re: Foreign Key problems with legacy database

2013-07-23 Thread Nick Dokos
Avraham Serour writes: > you don't need songid = models.Integerfield() ... and the ForeignKey should not specify a db_column. > > On Tue, Jul 23, 2013 at 6:04 AM, Brian Millham wrote: > > I have the following models: > > class Requestlist(models.Model): >    id = models.Int

Re: Foreign Key problems with legacy database

2013-07-23 Thread Avraham Serour
you don't need songid = models.Integerfield() On Tue, Jul 23, 2013 at 6:04 AM, Brian Millham wrote: > I have the following models: > > class Requestlist(models.Model): >>id = models.IntegerField(primary_key=True) >>songid = models.Integerfield() >>song = ForeignKey('Song', db_column

Foreign Key problems with legacy database

2013-07-22 Thread Brian Millham
I have the following models: class Requestlist(models.Model): >id = models.IntegerField(primary_key=True) >songid = models.Integerfield() >song = ForeignKey('Song', db_column='songid') > class Song(models.Model): > id = models.IntegerField(primary_key=True) > title = models.CharFie

Foreign key problems with legacy database

2013-07-22 Thread Brian Millham
I have these 2 models: class Requestlist(model.Model): -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to

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
bjects.get(id=1229) s.title # should be OK still s.played_set.all() # should be a list of plays. On Saturday, May 11, 2013 5:33:46 PM UTC-5, Brian Millham wrote: > > Hi all, > I'm just trying to learn Django. I have an existing site that I wrote in > PHP, and I'l consider

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 ManyToManyF

Re: Problem with intermediary table from legacy database

2013-04-04 Thread Vittorio
Thanks a lot Russ Magee, now it works. Ciao Vittorio Il giorno 04/apr/2013, alle ore 14:24, Russell Keith-Magee ha scritto: > > > On Thu, Apr 4, 2013 at 6:48 PM, Tom Evans wrote: > On Thu, Apr 4, 2013 at 11:35 AM, Russell Keith-Magee > wrote: > > > > > > On Thu, Apr 4, 2013 at 5:28 PM, Vittori

Re: Problem with intermediary table from legacy database

2013-04-04 Thread Russell Keith-Magee
On Thu, Apr 4, 2013 at 6:48 PM, Tom Evans wrote: > On Thu, Apr 4, 2013 at 11:35 AM, Russell Keith-Magee > wrote: > > > > > > On Thu, Apr 4, 2013 at 5:28 PM, Vittorio wrote: > >> > >> Under Django 1.5.1 I'm having a go at using ManyToManyField (see below > models.py and admin.py files) referring

Re: Problem with intermediary table from legacy database

2013-04-04 Thread Tom Evans
On Thu, Apr 4, 2013 at 11:35 AM, Russell Keith-Magee wrote: > > > On Thu, Apr 4, 2013 at 5:28 PM, Vittorio wrote: >> >> Under Django 1.5.1 I'm having a go at using ManyToManyField (see below >> models.py and admin.py files) referring to an Sqlite3 legacy db. >> >> I'm receiving the following fat

Re: Problem with intermediary table from legacy database

2013-04-04 Thread Russell Keith-Magee
On Thu, Apr 4, 2013 at 5:28 PM, Vittorio wrote: > Under Django 1.5.1 I'm having a go at using ManyToManyField (see below > models.py and admin.py files) referring to an Sqlite3 legacy db. > > I'm receiving the following fatal error message in admin > > Exception Value: > > 'LibroOption.fields' ca

Problem with intermediary table from legacy database

2013-04-04 Thread Vittorio
Under Django 1.5.1 I'm having a go at using ManyToManyField (see below models.py and admin.py files) referring to an Sqlite3 legacy db. I'm receiving the following fatal error message in admin Exception Value: 'LibroOption.fields' can't include the ManyToManyField field 'autore' becaus

Re: manytomany field and intermediary table from a legacy database

2013-03-28 Thread Pankaj Singh
Hey Vittorio, ManyToManyField has one optional argument for specifying db_table(http://bit.ly/10ciWdu). Since, you have different column names, you should create a new model. and specify that model as `through` argument(http://bit.ly/10cjdgz). And set `db_table` in `Meta` class of this model. In

manytomany field and intermediary table from a legacy database

2013-03-27 Thread Vittorio
I know that when I define a manytomany field automagically "behind the scene Django creates an intermediary join table to represent the many-to-many relationship". Now I have a legacy MySQL db, feeded by an existing procedure built in Filemaker via ODBC, which I would like to use with django to

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread Alexander
Thank you for such a comprehensive answer. I chose to add the field to the table. It seems to be the best 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-us...@googlegroups.com. To unsubscri

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread David De La Harpe Golden
On 15/10/10 12:15, Alexander wrote: > As you can see the 'rating' table has no separate primary key field. Yeah, that is pretty commonplace (though not presently supported by django), the natural primary key for a table may be composite... > Here are the models created by Django with some my cor

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread Alexander
Thanks for your reply. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread Devin M
Wait... I just looked at your sql and it looks like you would need to use multiple-column primary keys which are unsupported by django. http://code.djangoproject.com/ticket/373 On Oct 15, 4:15 am, Alexander wrote: > I have a database, which among others has the following tables: > > CREATE TABLE

Re: Legacy database with a table, which has no separate primary key

2010-10-15 Thread Devin M
I did some quck googling and found this. http://stackoverflow.com/questions/605896/django-querying-read-only-view-with-no-primary-key This is the response from them that seems most helpful. "all you need is a column that is guaranteed to be unique for every row. Set that to be 'primary_key = True

Legacy database with a table, which has no separate primary key

2010-10-15 Thread Alexander
I have a database, which among others has the following tables: CREATE TABLE users ( userId BIGINT PRIMARY KEY ); CREATE TABLE movies ( movieId BIGINT PRIMARY KEY, title varchar(255) NOT NULL ); CREATE TABLE ratings ( userId BIGINT NOT NULL REFERENCES users(userId), movieId BIGINT NOT

django and legacy database

2010-10-08 Thread tony yu
I have a legacy database and have user and password with plain-text or md5 encryption Now, I want an app or function, when the user signup, change or reset the password, the record of legacy databases will change synchronously. I would like to keep the existing account app, how can I do? -- You

Re: Testing many-to-many models on a legacy database

2010-07-11 Thread derek
ust not sure where > > > this > > > is... > > > I have a setup which includes a number of many-to-many models in a legacy > > > database.  For example: > > > > class Grouping(models.Model): > > >     id = models.AutoField(primary_key=True, d

Re: Testing many-to-many models on a legacy database

2010-07-11 Thread derek
es a number of many-to-many models in a legacy > > database.  For example: > > > class Grouping(models.Model): > >     id = models.AutoField(primary_key=True, db_column='GroupingID') > >     name = models.CharField(max_length=250, db_column='GroupingNam

Re: Testing many-to-many models on a legacy database

2010-07-10 Thread Rolando Espinoza La Fuente
On Sat, Jul 10, 2010 at 9:31 AM, Derek wrote: > Running Django 1.2.1 under Python 2.6. > I am obviously missing something cruccial, but I am just not sure where this > is... > I have a setup which includes a number of many-to-many models in a legacy > database.  For example: >

Testing many-to-many models on a legacy database

2010-07-10 Thread Derek
Running Django 1.2.1 under Python 2.6. I am obviously missing something cruccial, but I am just not sure where this is... I have a setup which includes a number of many-to-many models in a legacy database. For example: class Grouping(models.Model): id = models.AutoField(primary_key=True

Primary key error for ManyToManyField in a legacy database

2010-06-19 Thread derek
I have a legacy database setup like this: class Team(models.Model): id = models.AutoField(primary_key=True, db_column='TeamID') name = models.CharField(max_length=100, db_column='TeamName') groupings = models.ManyToManyField(Grouping, related_name='groupings

Django 1.2 and legacy database

2010-05-04 Thread Xavier Ordoquy
Hello, I'm seriously considering django 1.2 for a project which uses several databases. However, I still got an issue with django 1.2 about legacy database. I do have many to many relation that goes throught and table without primary key. I don't want to use an intermediate model sin

Using legacy database with Django

2010-04-18 Thread Daniel Winter
Hello, I am evaluating the use of Django for a project. I went through the tutorial and read some of the other documentation. The problems is we use an existing database structure. There is no real way arround using that. So I would like to hear if and how you would use that with Django. Let

Re: Legacy database - does every table need an id column?

2009-11-01 Thread James Bennett
On Sun, Nov 1, 2009 at 10:56 PM, Nick Arnett wrote: > As I ask the question, it now seems clear to me that the column is > needed. There must be a field on the model with "primary_key=True". If a model is defined without such a field, Django assumes an implicit auto-incrementing field named "id"

Legacy database - does every table need an id column?

2009-11-01 Thread Nick Arnett
I'm hoping to use Django with a legacy database and I'm suspecting that things are not working as they should because the database has tables that lack the "id" column that Django generates from the same model. Searching the documentation, I don't see anything that i

Re: Empty [] using objects.all() on legacy database

2009-06-23 Thread Karen Tracey
On Tue, Jun 23, 2009 at 12:04 PM, Greg Corey wrote: > Ok. I will work on opening a ticket based on your recommendation, though I > will not have your depth of analysis on the problem. Mind if I quote your > most recent explanation if needed? > Sure, but it's probably not necessary, though you co

Re: Empty [] using objects.all() on legacy database

2009-06-23 Thread Greg Corey
Ok. I will work on opening a ticket based on your recommendation, though I will not have your depth of analysis on the problem. Mind if I quote your most recent explanation if needed? Greg On Tue, Jun 23, 2009 at 8:41 AM, Karen Tracey wrote: > On Mon, Jun 22, 2009 at 2:19 PM, Erik Vorhes wrote

Re: Empty [] using objects.all() on legacy database

2009-06-23 Thread Karen Tracey
On Mon, Jun 22, 2009 at 2:19 PM, Erik Vorhes wrote: > > On Mon, Jun 22, 2009 at 12:52 PM, Greg Corey wrote: > > Karen, the double % ( i.e. 'discount%%') worked. Is this a big enough bug > > that it should be reported? I'm not sure what is a bug and what is just > my > > ignorance. Thank you sooo

Re: Empty [] using objects.all() on legacy database

2009-06-22 Thread Greg Corey
I figured it wasn't a bug and I just had to do the right escape sequence, but Karen mentioned that it might be a bug. Guess not. Hope this helps someone else in the future. Greg On Mon, Jun 22, 2009 at 12:19 PM, Erik Vorhes wrote: > > On Mon, Jun 22, 2009 at 12:52 PM, Greg Corey wrote: > > Kare

Re: Empty [] using objects.all() on legacy database

2009-06-22 Thread Erik Vorhes
On Mon, Jun 22, 2009 at 12:52 PM, Greg Corey wrote: > Karen, the double % ( i.e. 'discount%%') worked. Is this a big enough bug > that it should be reported? I'm not sure what is a bug and what is just my > ignorance. Thank you sooo much for the help. The first % escapes the second % sign, and th

Re: Empty [] using objects.all() on legacy database

2009-06-22 Thread Greg Corey
Karen, the double % ( i.e. 'discount%%') worked. Is this a big enough bug that it should be reported? I'm not sure what is a bug and what is just my ignorance. Thank you sooo much for the help. Greg On Fri, Jun 19, 2009 at 8:09 PM, Greg Corey wrote: > I will try that tomorrow and let you know.

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread Greg Corey
I will try that tomorrow and let you know. The DB is an old Microsoft Access database that was then migrated to MySQL. It was designed by a definite novice so it has quirks, but it still pumps along. It is a DB of testing results for our small laboratory. Greg On Fri, Jun 19, 2009 at 8:00 PM, Ka

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread Karen Tracey
On Fri, Jun 19, 2009 at 4:41 PM, geraldcor wrote: > > Ok, so I feel a bit silly, but it was because I had a column name in > my db called Discount% and I am assuming the % is screwing it up. > > Now the question becomes how do I escape the % or do I have to rename > my db column (please god not t

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread geraldcor
stuff). I already tried some unicode stuff but I'm fairly untrained in that area. Any ideas? Thanks Greg On Jun 18, 4:41 pm, geraldcor wrote: > Hello all, > > I am trying to work with a legacy database and I ran inspectdb and > have a model with the 2 tables that I want to use

Empty [] using objects.all() on legacy database

2009-06-18 Thread geraldcor
Hello all, I am trying to work with a legacy database and I ran inspectdb and have a model with the 2 tables that I want to use. The first table, the main table is not working at all. The second table which is related via a foreign key seems to be working just fine. Here are the symptoms: In

Legacy database, many-to-many field, custom column name and generic foreign key

2008-05-31 Thread MiloZ
Hi, Here's the problem: class AssociationClass(models.Model): fk_model1 = models.IntegerField() fk_model2 = models.IntegerField() model2_type = models.IntegerField() after an inspectdb, I would like to tell django that this is an association class, with a generic foreign key. What

Re: legacy database

2008-05-08 Thread marcoshernandez
Thanks, Thougt was included in the python distribution. what a shame! XD On 7 mayo, 22:05, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 6:53 PM, marcoshernandez <[EMAIL PROTECTED]> wrote: > > I have a legacy database in mysql and i tried to

Re: legacy database

2008-05-07 Thread Karen Tracey
On Wed, May 7, 2008 at 6:53 PM, marcoshernandez <[EMAIL PROTECTED]> wrote: > I have a legacy database in mysql and i tried to create the models > with the manage.py inspectdb --settings =path.to.settings command, but > the script crashes and says MySQLdb module doesn't exists

legacy database

2008-05-07 Thread marcoshernandez
I have a legacy database in mysql and i tried to create the models with the manage.py inspectdb --settings =path.to.settings command, but the script crashes and says MySQLdb module doesn't exists (literally it says: "Error loading MySQLdb modul

Re: Can I use Django to display data form a legacy database?

2008-05-04 Thread Justin Bronn
> Thanks.  To be sure, when I do the python manage.py syncdb, that > doesn't alter my existing database does it?  What is syncdb doing in > this case? It is typically worth the effort to search the docs: http://www.djangoproject.com/documentation/django-admin/#syncdb Particularly, read the high

Re: Can I use Django to display data form a legacy database?

2008-05-04 Thread jmDesktop
On May 4, 12:22 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, May 3, 2008 at 11:55 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > > > If all I want to do is display a row(s) from a legacy database, one > > that I did not create with Django and syn

Re: Can I use Django to display data form a legacy database?

2008-05-03 Thread Karen Tracey
On Sat, May 3, 2008 at 11:55 PM, jmDesktop <[EMAIL PROTECTED]> wrote: > > If all I want to do is display a row(s) from a legacy database, one > that I did not create with Django and syncdb, will Django do that? Do > I have to alter my legacy database in any way (assume it&#

Can I use Django to display data form a legacy database?

2008-05-03 Thread jmDesktop
If all I want to do is display a row(s) from a legacy database, one that I did not create with Django and syncdb, will Django do that? Do I have to alter my legacy database in any way (assume it's a pre- existing MySQL, Oracle, or SQL Server database)? Than

Re: admin interface for legacy database

2006-10-16 Thread Ewout ter Haar
So putting a non-existent non-NULL value in that field means it is > no longer a foreign key. Yes, I think that in my legacy database the relationship is not implemented on the database level (with constraints (?)) but only on the php, aplication level. Likewise, that "user.icon = -1"

Re: admin interface for legacy database

2006-10-15 Thread Malcolm Tredinnick
On Sat, 2006-10-14 at 04:47 -0700, Ewout ter Haar wrote: > I am trying to make use of the django admin, to use with a database > which is normally managed by another (PHP) application. I ran > inspectdb, and after tweaking the models a little bit, it works for > basic fields like InterFields, Char

Re: admin interface for legacy database

2006-10-14 Thread moberley
I'm not familiar with how ForeignKey fields interact with the database, but I wondered if you could have an instance of the Icon model that represented no icon (-1). Otherwise, I think you might need to override the model methods (probably the save() method), but that's just a guess. --~--~-

admin interface for legacy database

2006-10-14 Thread Ewout ter Haar
I am trying to make use of the django admin, to use with a database which is normally managed by another (PHP) application. I ran inspectdb, and after tweaking the models a little bit, it works for basic fields like InterFields, CharFields etc. I would also like to use the ForeignKey features tha

import a model from a legacy database

2006-06-01 Thread coldas57
Hi all, I have recently added a legacy database on mysql to use with django. Now, I run python manage.py shell in order to become familiar with the database api. I am trying to run the first sentence: switch.get_list() and I receive the following error AtributeError: type object 'switch

foreign (not legacy) database and many-to-many

2006-01-13 Thread Dmitry Sorokin
Hello, I have used legacy database docs to use django with database produced by gnuenterprise http://www.gnuenterprise.org application server. As gnue-appserver requires to use gnue_id field as primary key (32-char long UUID) I then manually modified the model to something like this: from

foreign (not legacy) database and many-to-many

2006-01-13 Thread Dmitry Sorokin
Hello, I have used legacy database docs to use django with database produced for gnuenterprise http://www.gnuenterprise.org application server.