You are right. Just as i got the same result I saw your post. And this:
> Second, MySQLdb quotes parameters before putting them into the
> placeholder, so you'd end up with
>
> ... like ''something'%'
I saw that happen in the query ^_^
This is the final code for it:
class item_search(model
On Thu, Dec 22, 2011 at 11:33 PM, Edvinas Narbutas wrote:
> I get this error. "not enough arguments for format string", which im
> guessing the LIKE isnt working because this query works.
>
No, LIKE is working fine, it's your Python string that's broken.
item_search_results = itemSearch.object
Putting django aside for the moment, are you able to take the sql that
you wrote above and write a python script with the sql code above.
I use the pyodbc module to perform all of my sql scripts.
Once you write the successful python sql script, you can import this
working module into a django vie
Yeah, the ORM didn't work out as i thought for this. I have written
this raw query with a model. Alot less code compared to as before.
class itemSearch(models.Model): typeID =
models.SmallIntegerField(primary_key = True)typeName =
models.CharField(max_length = 200)
item_search_results = itemS
I think you are limiting yourself by excluding sql.
I use the ORM for the admin side of the house and I use sql for all of
my web based presentations.
SQL will do everything that you want to achieve.
ORM has limitations as you have seen.
On Dec 22, 7:27 am, kr0na wrote:
> Im trying to compare
Im trying to query the second DB for information. Its a back up from
another database, its separate from default, here is the settings.py
-> DATABASES:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': '#',
'USER': '#',
'PASSWORD': '#',
On Thu, Dec 22, 2011 at 12:27 PM, kr0na wrote:
> Im trying to compare two tables in a second database that is a
> migrated database from mssql. The second database doesn't have any
> apps for it, it will only be used for queries.
>
> This are my models for the two tables.
> from django.db import m
Im trying to compare two tables in a second database that is a
migrated database from mssql. The second database doesn't have any
apps for it, it will only be used for queries.
This are my models for the two tables.
from django.db import models
class invGroups(models.Model):
groupID = mod
8 matches
Mail list logo