Re: use same database across various applications in a django project?

2012-07-13 Thread Burhan
sounds like a great idea! I never thought of this. thanks again :) On Friday, July 13, 2012 12:33:30 AM UTC+2, Burhan wrote: > > Hi, > > I have a project which has two applications, app_1 and app_2, when I run > "python manage.py syncdb" it creates tables defined in m

Re: use same database across various applications in a django project?

2012-07-13 Thread Burhan
s for app2. is it possible to use the same model class for both app, at the moment models.py is placed in both app1 and app2. regards Burhan On Friday, July 13, 2012 12:33:30 AM UTC+2, Burhan wrote: > > Hi, > > I have a project which has two applications, app_1 and app_2, when I ru

use same database across various applications in a django project?

2012-07-12 Thread Burhan
e the same table prefix rather two different prefix. more precisely I want my both apps use same model and one single database. any help in this regard would be appreciated. Thanks, Burhan -- You received this message because you are subscribed to the Google Groups "Django users&

Re: Django and Rich Client

2011-06-18 Thread Burhan
On Jun 9, 9:10 pm, Knack wrote: > Current plans are: > > 1) Using an Oracle DB > 2) LDAP authentification > 3) Role based authorisation. Here I'm a bit unsure about the approach. > I would implement it by myself within the django world (don't know yet > where exactly).

Storing Record State

2011-06-18 Thread Burhan
I am developing an application where each instance of a Model object needs to have some state information attached to it, and it needs to be able to roll back to the previous state. This is mainly for auditing purposes. The logic goes like this (take a simple Books model): class

Re: RE: 'str' object is not callable

2011-02-18 Thread Burhan
Where is 'deletion_time' defined, in reference to the urls.py? The error is that urls.py can't resolve deletion_time, which is why its saying that "I cannot call a string object". I would investigate that. Try qualifying it by giving it the module name. On another note, you can concatenate

Re: list indices must be integers not unicode

2011-02-18 Thread Burhan
id_list = [int(x) for x in data.keys() if x.isdigit()] -- 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

Re: request in urls.py

2011-02-18 Thread Burhan
method: /logout /logout?next=/home /logout?next=/home/=bar def logout_user(request): # - do your logout routine next = request.GET.get('next','/home') return redirect(next) Hope this helps, -- Burhan Khalid On Feb 18, 1:15 pm, galago <prog...@gmail.com> wrote: > Is it possibl

Re: list indices must be integers not unicode

2011-02-18 Thread Burhan
You need to filter your search in request.POST for fields that match your forms. The post querydict will hold all fields submitted in the form, in your case the error is because you are trying to convert 'csrfmiddlewaretoken' (a key in POST) to an integer which is not possible. On Feb 18, 3:27 

Re: method being called twice?

2011-02-03 Thread Burhan
The log entries for a session are here: http://dpaste.com/380749 -- 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

Re: method being called twice?

2011-02-03 Thread Burhan
Thank you all for your comments. Perhaps I should clarify: 1. I'm not really interested in what is in the querystring, I'm only interested in what is being sent as part of the POST request. 2. The method's full body is posted here: http://dpaste.com/380708; the method "breaks" at line 8 with

method being called twice?

2011-02-02 Thread Burhan
Hello, I have a strange problem which I am unable to figure out. I have a method that is POSTed some information from a third-party payment gateway. The request is sent to payment-result.jsp? PaymentID=342 (where 342 is any integer). My URL pattern is: (r'^payment-result.jsp$', result) The

Re: Need HELP urgently

2011-01-12 Thread Burhan
): raw_id_fields = ('entry',) admin.site.register(Priority,PriorityAdmin) Regards, -- Burhan Khalid On Jan 12, 8:27 am, gupta-django <gupta55...@gmail.com> wrote: > I have two application > > 1. App1 - It has a Model Class "Entry" that has 20 entries > 2. App2 - It

CSRF cookie not being sent over HTTPS

2011-01-12 Thread Burhan
I'm developing an app that is only going to be used over HTTPS, when I try to login to the admin backend, I keep getting 'Looks like your browser isn't configured to accept cookies. Please enable cookies, reload this page, and try again.' I inspected the cookies being sent and noticed that the

Re: ModelForm validation in 1.2.3

2010-12-30 Thread Burhan
On 30/12/10 17:25, Burhan wrote: > > >  In 1.2.3, this logic always fails because "is_clean()" fails if an > > existing customer enter's their email address. How can I do the same > > using django 1.2.3? > > http://docs.python.org/tutorial/errors.html > -BE

ModelForm validation in 1.2.3

2010-12-30 Thread Burhan
Hello: In 1.2 ModelForm validation was changed so that not only does it check the form validation, but it does validation of the model as well. I have a model that has custom validation for one of its fields, which should be unique in the table. Now I have a front end form, created by

Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks for that, I managed to get my form working the way I want. Now the only problem is I need to duplicate this form, well, actually, I need the user to be able to add multiple "items" in one view. Right now my form is "ModelForm", so to get multiple model forms in one view (and get the

Re: inline-model-formset help

2010-12-27 Thread Burhan
Thanks, but I'm not sure which models to pass to it, when it asks for two models in this: " If you want to create a formset that allows you to edit books belonging to a particular author, you could do this: >>> from django.forms.models import inlineformset_factory>>> BookFormSet = >>>

Re: Project management / bugtracking app?

2010-12-26 Thread Burhan
Second redmine. It has a come a long way and the plugins are great. Also quite simple to setup. -- 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,

Re: inline-model-formset help

2010-12-26 Thread Burhan
I forgot to add that this is the model that defines the relationship between a merchant and a product: class PriceList(models.Model): product = models.ForeignKey(Product) merchant = models.ForeignKey(Merchant) minimum_price = models.FloatField(verbose_name=_(u'Minimum Price'),

inline-model-formset help

2010-12-26 Thread Burhan
I have a simple model: class LineItem(models.Model): customer = models.ForeignKey(Customer) merchant = models.ForeignKey(Merchant) product = models.ForeignKey(Product) child = models.ForeignKey(Pupil) amount = models.FloatField(blank=False,editable=False, default=1.000) In my

Modifying default permissions given to a model

2010-12-22 Thread Burhan
Hello All: I am creating a model that should only be 'read-only' in the admin. That is, the only way to add new records in the database for this model is through the code, not manually. However, I would like the admin user to be able to view entries in this model. An example of such a model

Problems Doing Slightly Complex Logic

2006-12-17 Thread Burhan
Hello Everyone: About the third time I have tried Django, and everytime I'm running into a problem where that it seems there is no easy way to do a complex task. Well, not that complex in my opinion, just can wade through the documentation to find the right thing I need. A person creates a

Re: SQLAlchemy Progress

2006-12-16 Thread Burhan
Thanks Adrian, I had a look -- but nothing of substance is there. Is this branch still active or has been abandoned? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

SQLAlchemy Progress

2006-12-05 Thread Burhan
Hello: Is there any update on the SQLAlchemy integration project? The last thread is too old for me to reply to. Regards, Burhan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Lost in the Admin section...

2006-08-22 Thread Burhan
Finally, something I do know about because I struggled with the same problem! > (1) My model includes an Event class. Events should be displayed > using the date as their name. So the name of the event might be > "August 25th, 2006". But if I add a def(self): __str__(self.date) to > the class, I

Re: Better way to do this?

2006-08-22 Thread Burhan
Thanks Russ. Is there a way to have a multiple select drop down without using a m2m and a filter? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Better way to do this?

2006-08-22 Thread Burhan
First, thanks for your opinons. Tim: This was what I did the first way I did it, because it didn't make sense to me to have a table that is just going be used for a lookup. However, with that option, I didn't get the option to do a multiple select on the days. If a flight is only on sunday or

Better way to do this?

2006-08-22 Thread Burhan
Hello Everyone: I am trying my luck with django again, and I found a way to show a list of related objects in a many-to-many relationship, using the following model and view: Model # Flight Frequency class Frequency(models.Model): day_translated = {'Sa': 'Saturday', 'Su': 'Sunday',

Re: admin-view, password-md5 problem

2005-12-27 Thread Burhan
I found this "hack" that does it very nicely. Forgot who gave me the link; and the link itself :( from django.models.auth import User def user_pre_save(self): if not self.password.startswith('sha1$'): self.set_password(self.password) User._pre_save = user_pre_save Add this in your

Re: Registered and unregistered users

2005-12-27 Thread Burhan
You could probably use the permissions system to achieve this. I know I have done this before (but not in Django) to similar effects. Each user (guest, authenticated, priviledged or otherwise) will have permissions that define what they do. You can then move people around the permission groups

Translate db api in model

2005-12-26 Thread Burhan
et the same number in the model, which I tried using: def _pre_save(self): lastid = self.get_values(fields=['id'])[-1:][0]['id'] self.wonum = 'WO-'+lastid+1 I get the following error. 'WorkOrder' object has not attribute 'get_values'. Any ideas? Regards, Burhan

Re: Problem in Admin section, in shell works great

2005-12-24 Thread Burhan
Aye, this was it. Still very green with Python. Thanks for making Django. Its forcing me to learn Python, which is turning out to be not-such-a-bad idea :)

Re: downloadable django documentation?

2005-12-21 Thread Burhan
For the impatient, you can disable CSS in your browser and get a nice 'print friendly' version.

Re: php, mod_python postgresql conflict?

2005-12-18 Thread Burhan
What environment have you seen this problem? I am running mod_php, mod_python and MySQL (and PostgreSQL) all on one server with Apache2 -- haven't run into your issue.