Re: Django Session KeyError

2020-02-25 Thread Pankaj Sharma
Make sure your line request.session['ts_dataset_copy'], print anything 
above it, also make sure you are using POST method in forms (method = 
"post") 

On Tuesday, February 25, 2020 at 3:47:25 AM UTC+5:30, Guy NANA wrote:
>
> I have an angular frontend app which send file to django backend which 
> data is setting in django session. After I send a httprequest to django 
> backend to make ML tratements on that data and get the results. But I've a 
> 500 sever error: keyerror 'ts_dataset_copy': KeyError: 'ts_dataset_copy'
> [24/Feb/2020 18:43:46] "GET /cv_classification/5/FOTS/283/None/0/0 
> HTTP/1.1" 500 78264. Here are my django code:
>
> Firstly I upload timeseries dataset file from angular frontend (All thing 
> is ok)
> @csrf_exempt
> def upload_local_dataset(request):
> if request.method == 'POST':
> dataset = pd.read_csv(request.FILES.get('datasetfilepath'), 
> header=None, index_col=None)
> request.session['ts_datset'] = dataset.to_json(orient='values'
> )
> request.session['ts_dataset_copy'] = dataset.to_json(orient=
> 'values')
> 
> return HttpResponse(dataset.to_json(orient='values'))
>
>
>
> # second httrequest that throws a server internal error
>
> def cv_classification(request, kfolds, dissimilarity_func, 
> windows_length=0, noisy_law="", mu=0, 
> 
> std=0):
> noisy_law = noisy_law.lower()
> df = pd.read_json(request.session['ts_dataset_copy'], orient=
> 'values')
> predictions = cv_classify(df, kfolds, dissimilarity_func, 
> windows_length, noisy_law, mu, std)
> return JsonResponse(predictions, safe=False)
>
>
>
> Thanks for your help!
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1822d7cf-442d-4f9d-83ea-9037e8a98408%40googlegroups.com.


Re: reg: Error:-django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'Description' used in key specification without a key length")

2020-02-25 Thread Pankaj Sharma
You haven't set max_len of TextField, use this - do it like this --  
Description = models.TextField(max_length=1000)

On Monday, February 24, 2020 at 8:14:25 PM UTC+5:30, Amitesh Sahay wrote:
>
> Hi, 
>
> I am creating a model, which is taking a description as text field. when I 
> migrate I see the below error:
>
> django.db.utils.OperationalError: (1170, "BLOB/TEXT column 'Description' 
> used in key specification without a key length")
>
> ON further research I came to know that its some limitation with MySQL. I 
> am using MYSQL for my dev. Below is the link that describes the issue.
>
> MySQL error: key specification without a key length 
> 
>
> MySQL error: key specification without a key length
>
> I have a table with a primary key that is a varchar(255). Some cases have 
> arisen where 255 characters isn't enou...
>
> 
>
> *So what am I suppose to use if not TextField? I have tried CharField, 
> that doesn't work either. Below is the model details:*
>
>
>
>
>
>
>
>
>
> *class OnlineShop(models.Model): Product_name = 
> models.CharField(max_length=100, unique=True) Price = models.IntegerField() 
> Slug = models.SlugField(max_length=250, unique=True) Description = 
> models.TextField() Curr_Time = models.DateTimeField(auto_now_add=True) def 
> __str__(self): return '{}'.format(self.Product_name)*
>
>
> Regards,
> Amitesh Sahay
> *91-750 797 8619*
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e96fa8d-a9d1-4dbf-bcbe-7596ed9d3975%40googlegroups.com.


Coding used for dropbox

2012-03-11 Thread pankaj sharma
Hello everyone,
i want to know that which language and framework was used for making
dropbox,
and i want to make such website, so can i make it in django, if not which
framework and language should i use?



-- 
Pankaj Sharma
Third Year Undergraduate Student
Department of Civil Engineering
Indian Institute of Technology Kharagpur
Ph: +91 9547891751
Email: new.pankajsha...@gmail.com

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: WORKSHOP ON DJANGO AND OTHER WEBDESIGNING STUFF

2011-08-11 Thread pankaj sharma
please visit this link http://www.facebook.com/ednect

On Aug 10, 10:05 pm, pankaj sharma <new.pankajsha...@gmail.com> wrote:
> hello friends there is a workshop to be conducted in india (kolkata)
> by ednect services, it will also include information about django
> if we want that everybody use django so everybody will try to conduct same
> kind of workshop in their cities.
> and also like this link
>
>    http://www.facebook.com/pages/Ednect-Services/252079971482683

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Worshkop

2011-08-10 Thread pankaj sharma
hello friends there is a workshop to be conducted in india (kolkata)
by ednect services, it will also include information about django
if we want that everybody use django so everybody will try to conduct
same kind of workshop in their cities.
and also like this link

   http://www.facebook.com/pages/Ednect-Services/252079971482683

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



let the users download files

2011-06-28 Thread pankaj sharma
hello friends ,
i have a database in which i have some files say photos...
{i am uploading photos from django admin.}
i want to make a template so that the users of my website can download
these photos ..
so can anyone provide me some useful information or any link

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



files managing

2011-06-06 Thread pankaj sharma
hello everyone, i need some help;
i want the users to download some files.. {say photos}
and what setting do i have to take care using FileField. where all
these photos will be stored and how can user download the photos

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



File Field

2011-05-12 Thread pankaj sharma
Hello friends,.
i want to upload some files to my database and show it to user ..
how to add an filefield option to models.py and how to show them in
admin.py.
and how to let the users download the files...

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: haystack

2011-05-12 Thread pankaj sharma

can u tell me which one is better in sphinx and haystack

On May 11, 10:01 pm, Tarkeshwar Thakur <tarkesh...@gmail.com> wrote:
> In your settings filehttp://docs.djangoproject.com/en/dev/topics/settings/
>
> On Thu, May 12, 2011 at 10:20 AM, pankaj sharma
> <new.pankajsha...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > hello friends, i want to use haystack for my website,
> > but i am having too many problems to install it.
> > in the dowumentation it is telling to add haystack to ur installed
> > apps. now it it telling to do "HAYSTACK_SITECONF =
> > 'myproject.search_sites'"
> > now where should i type this i dont have any idea about so please help
> > me
>
> >http://docs.haystacksearch.org/dev/tutorial.html
>
> > --
> > 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, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> - Tarkeshwar
> Blog: tarkeshwar.com <http://www.tarkeshwar.com>
> Pet project: operty.com <http://www.operty.com>

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



haystack

2011-05-11 Thread pankaj sharma
hello friends, i want to use haystack for my website,
but i am having too many problems to install it.
in the dowumentation it is telling to add haystack to ur installed
apps. now it it telling to do "HAYSTACK_SITECONF =
'myproject.search_sites'"
now where should i type this i dont have any idea about so please help
me

http://docs.haystacksearch.org/dev/tutorial.html

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: filter in python

2011-05-10 Thread pankaj sharma
thanku very much.

On May 9, 11:02 pm, Jani Tiainen <rede...@gmail.com> wrote:
> On Mon, 2011-05-09 at 06:15 -0700, pankaj sharma wrote:
> > i have 4 branches in a college..
> > some college have three some have 4 and so on
> > so i want to provide a search system to the user that they can see the
> > list of all the colleges which are having some branch say branch2 may
> > be he can select branch 3 and 4 and 1 also
> > so i am taking a query from the user for the branch so that i can
> > filter all the colleges having that branch.
>
> > no i did this ..
> > i took a query say B {and the calue of B may be branch 1, branch 2,
> > 3,&4 as i have given a selectbox to user to select any branch}
> > now in filter tag i did this
>
> > college_list = College.objects.filter(B=True)
>
> > but it is not working... so please tell me
>
> You have to construct your HTML to be something like this:
>
> 
>  Branch 1
>  Branch 2
>  Branch 3
>  Branch 4
> 
>
> And in code:
> # Retrieve branch column name:
> branch = form.cleaned_data['branch']
>
> # Build kwargs dictionary.
> # See python docs about keyword argument expansion
> branch_kwargs = { branch : True }
>
> # Create Q object (not necessary, see below)
> branch_q = Q(**branch_kwargs)
>
> # Filter
> college_list = College.objects.filter(branch_q)
>
> note that branch_q construction is not necessary, you can do it
> directly:
>
> college_list = College.objects.filter(**branch_kwargs)
>
> --
>
> Jani Tiainen

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: filter in python

2011-05-09 Thread pankaj sharma
i have 4 branches in a college..
some college have three some have 4 and so on
so i want to provide a search system to the user that they can see the
list of all the colleges which are having some branch say branch2 may
be he can select branch 3 and 4 and 1 also
so i am taking a query from the user for the branch so that i can
filter all the colleges having that branch.

no i did this ..
i took a query say B {and the calue of B may be branch 1, branch 2,
3,&4 as i have given a selectbox to user to select any branch}
now in filter tag i did this

college_list = College.objects.filter(B=True)

but it is not working... so please tell me

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



boolwan field filter

2011-05-09 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(default=False, blank=True)
   branch3 = models.BooleanField(default=False, blank=True)
   branch4 = models.BooleanField(default=False, blank=True)
now i want to provide user that they can search colleges from
branches..
so i am giving them a select box where they can select the city and
branches
suppose i get two queries c and b
so i will filter all the colleges having city = c and
Branches=b
so please tell me how to filter
i have filtered city but how to add one another filter for branch {as
it is bolleanfield}
college_list = College.objects.filter(city__title__icontains=Qcity)

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: filter in python

2011-05-09 Thread pankaj sharma
thanks for ur answer jani but i didn't get it . as i am getting one
query for branch {which is Qbranch} so where i use this?

On May 8, 10:40 pm, Jani Tiainen <rede...@gmail.com> wrote:
> 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 = models.BooleanField(default=False, blank=True)
> >    branch2 = models.BooleanField(default=False, blank=True)
> >    branch3 = models.BooleanField(default=False, blank=True)
> >    branch4 = models.BooleanField(default=False, blank=True)
>
> > now i want to provide user that they can search colleges from
> > branches..
> > so i am giving them a select box where they can select the city and
> > branches
> > suppose i get two queries Qcity and Qbranch
> > so i will filter all the colleges having city = Qcity and
> > Branches=Qbranch
> > so please tell me how to filter
>
> > i have filtered city but how to add one another filter for branch {as
> > it is bolleanfield}
> > college_list = College.objects.filter(city__title__icontains=Qcity)
>
> In case of branch1:
> college_list = College.objects.filter(city__title__icontains=Qcity,
> branch1=True)
>
> if you want to search multiple branches:
>
> branches_query = Q(branch1=True) | Q(branch2=True)
> college_list = College.objects.filter(branches_query,
> city__title__icontains=Qcity)
>
> Though since you have boolean field that will always be either true or
> false, you can construct:
>
> branches_query=Q(branch1=branch1_form_field_value) |
> Q(branch2=branch2_form_field_value) | ...
>
> --
>
> Jani Tiainen

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> 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 .
>
> 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 django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 
"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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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(default=False, blank=True)
   branch3 = models.BooleanField(default=False, blank=True)
   branch4 = models.BooleanField(default=False, blank=True)


now i want to provide user that they can search colleges from
branches..
so i am giving them a select box where they can select the city and
branches
suppose i get two queries Qcity and Qbranch
so i will filter all the colleges having city = Qcity and
Branches=Qbranch
so please tell me how to filter

i have filtered city but how to add one another filter for branch {as
it is bolleanfield}
college_list = College.objects.filter(city__title__icontains=Qcity)

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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
> and receive the city list, then populate the city drop-down.
>
>      Bind that function to the change event of your state drop-down box.
>
> This isn't a Django question, though. If you have trouble doing that try
> a JavaScript mailing list.
>
> I recommend using jQuery's .ajax() function for this.
>
> Shawn

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ajax select box

2011-05-07 Thread pankaj sharma
hello everybody...

i want to have an advanced search option...

i have a college database.. which has city state and other things ..

now i want to provide a search system to user such that they can
search colleges by city and states and names



i have given select box for states and city..


now the problem is
  if somebody has selected a state .. then i want to show onlky those
cities {in selectbox for city} which are in that state.

so please tell me how to do that...

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: stop repetition in template

2011-05-04 Thread pankaj sharma
actually i want both.. like


LIST OF ALL COLLEGES:
college1
city1


college2
city2


college3
city3





LIST OF CITIES

city1
city2
city3


{but is city2 = city3}
then it would show  :



LIST OF ALL COLLEGES:
college1
city1


college2
city2


college3
city3





LIST OF CITIES

city1
city2

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



stop repetition in template

2011-05-04 Thread pankaj sharma
hello friends,
 i have database of colleges.
i want to show all cities

so what is did is..
in template..

   {% for college in list %}
{{college.city}}
   {% endfor %}

in views.py

def list(request):
college_list=College.objects.all()
return render_to_response(
'college/list.html',
{'list':college_list}
)



so suppose i have two colleges in one city so it is showing the city
name twice  .. so how do i stop repetition..

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django searching

2011-05-02 Thread pankaj sharma
hello all,
i am trying to have an advanced search..
i have college list where there are many tables in college like
college.name, collge.city college.state etc.

so i have taken two strings from the user  like   Q1 and Q2.
now i want to show all the colleges which have Q1 string in name and
Q2 string in city..
basically i want to add "and" & "or" statement in this statement :


college_list = College.objects.filter(name__icontains=Q1)


so i want to add  one another filter   like  (city__icontains=Q2)

anyone please tell me..
thanks in advance

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Advanced Search

2011-05-02 Thread pankaj sharma
thanks.


On May 2, 1:52 am, Ankit Rai <i.ankit@gmail.com> wrote:
> Hi,
>
> Are city and name are the fields of your models?If yes than you can write
> your custom search using queryset , refer search implementation in django
> admin
>
> On Mon, May 2, 2011 at 1:41 PM, pankaj sharma 
> <new.pankajsha...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > i am new on django, i want to know how can we make advanced search on
> > our website.
>
> > i have database of colleges. and i want to provide the user to search
> > the colleges by :
> > city and name
>
> > i have made single search where user can enter the query and it will
> > show only those colleges having the query in their names
> > i also want to do it for city,
>
> > please help me
>
> > --
> > 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, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
>
> *Ankit Rai*
>
> *
> *

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Advanced Search

2011-05-02 Thread pankaj sharma
i am new on django, i want to know how can we make advanced search on
our website.


i have database of colleges. and i want to provide the user to search
the colleges by :
city and name

i have made single search where user can enter the query and it will
show only those colleges having the query in their names
i also want to do it for city,

please help me

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



problem using ManyToMany Field in admin

2011-03-22 Thread pankaj sharma
Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/admin/college/college/3/

Django Version: 1.3 rc 1
Python Version: 2.6.5
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'college']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/
base.py" in get_response
  111. response = callback(request,
*callback_args, **callback_kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
options.py" in wrapper
  307. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py" in _wrapped_view
  93. response = view_func(request, *args,
**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/views/decorators/
cache.py" in _wrapped_view_func
  79. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
sites.py" in inner
  197. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py" in _wrapper
  28. return bound_func(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py" in _wrapped_view
  93. response = view_func(request, *args,
**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
decorators.py" in bound_func
  24. return func(self, *args2, **kwargs2)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py"
in inner
  217. res = func(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/
options.py" in change_view
  992. form = ModelForm(instance=obj)
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py"
in __init__
  238. object_data = model_to_dict(instance, opts.fields,
opts.exclude)
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py"
in model_to_dict
  128. data[f.name] = [obj.pk for obj in
f.value_from_object(instance)]
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py" in _result_iter
  107. self._fill_cache()
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py" in _fill_cache
  772.
self._result_cache.append(self._iter.next())
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py" in iterator
  273. for row in compiler.results_iter():
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
compiler.py" in results_iter
  680. for rows in self.execute_sql(MULTI):
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
compiler.py" in execute_sql
  735. cursor.execute(sql, params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
util.py" in execute
  34. return self.cursor.execute(sql, params)
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/mysql/
base.py" in execute
  86. return self.cursor.execute(query, args)
File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py" in execute
  166. self.errorhandler(self, exc, value)
File "/usr/lib/pymodules/python2.6/MySQLdb/connections.py" in
defaulterrorhandler
  35. raise errorclass, errorvalue

Exception Type: DatabaseError at /admin/college/college/3/
Exception Value: (1146, "Table 'ednect.college_college_branches'
doesn't exist")

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.



PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread pankaj sharma
same as categories i have to add affiliation to every college.
so i added

class Affiliation(models.Model):
title = models.CharField(max_length=100)

def __unicode__(self):
return self.title

to models.py


and  added one more field to class of colleges

class College(models.Model):
   name = models.CharField(max_length=250)
   category = models.ForeignKey(Category)
   city = models.ForeignKey(City)
   affiliation = models.ForeignKey(Affiliation)### i added
this line to college class in models .py

now i changed my admin.py to this:



from django.contrib import admin
from college.models import *

class CollegeAdmin(admin.ModelAdmin):
list_display = ('name','category', 'city', 'affiliation')
list_filter = ['category', 'city']
search_fields = ['name', 'city']


class CityAdmin(admin.ModelAdmin):
list_display = ('title', 'state')
list_filter = ['state']
search_fields = ['title',]

admin.site.register(College, CollegeAdmin)
admin.site.register(City, CityAdmin)
admin.site.register(State)
admin.site.register(Category)
admin.site.register(Affiliation)


 but when i use syncdb command it shows no fixtures found

and when i click on college in admin site  then it show me error like
this


OperationalError at /admin/college/college/
(1054, "Unknown column 'college_college.affiliation_id' in 'field
list'")




now what to do? do i have to edit some more codes?

-- 
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, visit this group at 
http://groups.google.com/group/django-users?hl=en.