Django Model Errors : TypeError: 'class Meta' got invalid attribute(s): using

2012-01-31 Thread Subhodip Biswas
Hi all,
I am newbie in django and while trying to write a database router for
using multiple database  I did something like :

class Meta:
using = 'somedatabasename'

in Django models.py.

However while doing a syncdb I get an error like this :

TypeError: 'class Meta' got invalid attribute(s): using

what am I missing here??

any pointers or docs will be of great help.

-----
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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.



[Error] Mixing Two databases

2012-02-09 Thread Subhodip Biswas
Hi all,

I am trying to use two database for my django(Django nonrel 1.3.1)
project. One is Postgres and other is MongoDB.
After filling in details in settings.py :

DATABASES = {
'default': {
'ENGINE': 'django_mongodb_engine', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'Mongo_MSTR',  # Or path to
database file if using sqlite3.
'USER': '',  # Not used with sqlite3.
'PASSWORD': '',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for
default. Not used with sqlite3.
},
'geodata': {
'ENGINE': 'django.contrib.gis.db.backends.postgis', # Add
'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mydatabase',  # Or path to
database file if using sqlite3.
'USER': 'Username',  # Not used with sqlite3.
'PASSWORD': 'Password',  # Not used with sqlite3.
'HOST': '',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '',  # Set to empty string for
default. Not used with sqlite3.

}
}

Now if I am doing a
$ Python manage.py syncdb --database=geodata

I am getting a error like this :
django.db.utils.DatabaseError: Ordering can't span tables on
non-relational backends

If however I am executing the above without postgres service started,
I will get a error related to Postgres.
If I am explicitly mentioning the RDMS why is it throwing me error
based on MongoDB?

What am I missing here? Any pointers or documents will be of great help.


-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.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: [Error] Mixing Two databases

2012-02-10 Thread Subhodip Biswas
Hi,



On Fri, Feb 10, 2012 at 7:27 PM, Dennis Lee Bieber
 wrote:
> On Fri, 10 Feb 2012 09:32:02 +0530, Subhodip Biswas
>  wrote:
>
>
>        
>>I am getting a error like this :
>>django.db.utils.DatabaseError: Ordering can't span tables on
>>non-relational backends
>>
>        You don't, by some chance, have a model in one with a foreign key
> reference in the other?

I am trying to setup Geodjango over postgres. Since I am explicitly
mentioning my model to use postgres and not mongoDB. I thought I had
clear shot. but that is not the case and  might be the cause of the
problem. So how do I handle the settings now?

Any Ideas and pointers would help.




-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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 Userena Problem

2012-07-22 Thread Subhodip Biswas
Hi all,

I am using Django-userena for my registration process. I made a
custome model in a app called 'users'. However since custom model is
not handled by syncdb, I am using south. I tried to migrate but got
this error instead.
django.db.utils.DatabaseError: relation "users_userprofile" already exists

however when I am trying to signin into my system, I am getting this error

relation "users_profile" does not exist

I guess I am missing something out here, Any kind of help/pointers or
docs will be of great use.

My models.py looks something like this :

class Profile(models.Model):
GENDER_CHOICES =(
(1, _('Male')),
(2, _('Female')),
)


user =  models.OneToOneField(User,
unique=True,
verbose_name =('user'),
related_name = 'profile')
gender = models.PositiveSmallIntegerField(_('gender'),
 choices=GENDER_CHOICES,
 blank = True,
null=True)
website = models.URLField(_('website'), blank=True, verify_exists=True)
location = models.CharField(_('location'), max_length=255, blank=True)
birth_date = models.DateField(_('birth date'), blank=True, null=True)
about_me = models.TextField(_('about me'), blank = True)
@property
def age(self):
  some operations

def create_user_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)

post_save.connect(create_user_profile, sender=User)



-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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 Userena Problem

2012-07-28 Thread Subhodip Biswas
Hi all,

I kind of got over with the last problem but got stuck in step after that.
The previous problem was solved by naming the model to the first one,
Since that table was already created django refused to create the same
table structure against different name whatsoever.

However now, once past sign in or signup forms, when it comes to fetch
the profile using get_profiles(). I am getting a
SiteProfileNotAvailable error for already existing accounts but no
profile
 and
UserProfile matching query does not exist.

while for new signups I get a 'UserProfile' object has no attribute
'can_view_profile'

Documentation says the AUTH_PROFILE_MODULE should point to
appName.ModelName and it is okay in my case. users.UserProfile.

What am I missing here?



-----
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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.



querying data from Django userena profile.

2012-10-21 Thread Subhodip Biswas
Hi all,

I have defined my custom signupform as shown here.
http://docs.django-userena.org/en/latest/faq.html
I now want to query my custom defined profile as shown above and
retrieve a data(first_name) while the user is signed in. Once he signs
out that data is flushed out.
I see that with User profile, I can do a
request.user.get_profile.first_name in the template to retrieve the
first name. How do I do that in the views.py.
Any solution or pointer towards this in Django-Userena will be very helpful.


-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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: querying data from Django userena profile.

2012-10-22 Thread Subhodip Biswas
Hi all,

I have done a workaround the initial problem, all i did was add the
custom field into my apps models.py. This led to the data entered in
the custom field of signup form is shown in the edit_details page of
the user profile. However, unlike other data fields in edit_profile,
this custom field is not visible in view profile page.

Can anybody explain why is this happening and any workaround for this?
-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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.



Datastructure using django.

2012-12-10 Thread Subhodip Biswas
Hi all,

I am trying to implement a tree structure using django. There are two
packages I am looking at mptt and treebeard. Treebeard seems easy.

I have however two questions:

1. With mptt I found that if you have moved one child to another parent
both db and instance is updated but you need to reload or reregister every
time you call such action.Is there a better way of doing this?

2. If my child have more than one parent, the structure does not remain a
tree anymore. It becomes a graph i guess, How do you handle such situation.

3. How do I add treebeard or mptt into django admin. If I have one field
name and I register it in admin.py. I get error regarding depth,path,
numchild and name should be present. How do I handle this situation.

Apologies for asking so many questions.


-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com
http:/www.fedoraproject.org/wiki/SubhodipBiswas

-- 
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: Big Picture?

2013-07-14 Thread Subhodip Biswas
Hi,

That diagram clears a lot of misconceptions that I had. Thanks a lot for
that. Will keep it as a reference.





-
Regards
Subhodip Biswas


GPG key : FAEA34AB
Server : pgp.mit.edu
http://subhodipbiswas.wordpress.com



On Sun, Jul 14, 2013 at 8:38 PM, Amirouche Boubekki <
amirouche.boube...@gmail.com> wrote:

>
>
>>
>>> I normally dislike technical "diagrams", but this is simple and awesome
>>> :-) -- it's a really nice "big picture" and introduction to the different
>>> components that can be hard to visualize in one's head when just getting
>>> started .. do you mind if I use it when introducing people to Django? (with
>>> credit, of course:))
>>>
>>
>> Thanks!
>>
>> I've moved it online, with licensing cc by sa [1] so anybody anywhere can
>> use it, both png and svg version (edited with inkscape) are available.
>>
>
> an updated version with minor correction ;)
>
> Of course any contributions is welcomed.
>
>
>>
>> [1] http://creativecommons.org/licenses/by-sa/3.0/
>>
>  --
> 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 this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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 this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.