Re: Django and PHP webhosting in Germany

2012-06-17 Thread sjtirtha
Hi Mike,

I've checked the link before. The list shows me only 2 providers in
Germany which offer php and python from one box.
There are some other providers from Swiss, but they do not offer php.
That's why I asked question here. My following question is also, if I
do not have any root access, what is the limitation will I face in the
future for Django deployment. Web hosting normally does not offer root
access compared to virtual server.

I checked also in google and even asked two main german provider 1und1
and strato, but they haven't answer my emails yet.

Regards,
Steve

On Sun, Jun 17, 2012 at 9:55 AM, Mike Ryan <m...@fadedink.co.uk> wrote:
> Are "which webhost" questions really relevant to this list? I just did a
> quick search, and it seems this question is coming up more and more
> frequently. It seems quite out of place here, IMHO. I use this list to see
> interesting ways people use Django, or learn from other people's answers -
> not so I can keep up to date with which web hosts support django.
>
> Does anyone else feel that "which webhost..." questions should be politely
> responded to with a link to
> https://code.djangoproject.com/wiki/DjangoFriendlyWebHosts, and a request
> not to post similar questions in future? This is nothing personal Steve, I
> just feel the list is getting cluttered up with questions that are barely
> relevant to the group, and are easily answerable with some googling.
>
> Regards,
>
> Mike
>
>
> On Saturday, June 16, 2012 10:24:27 PM UTC+2, sjtirtha wrote:
>>
>> Hi,
>>
>> can somebody recommend a good and cheap web hosting for django and
>> php(wordpress)?
>> I'm looking something below 10 € monthly, only for small apps and blogs.
>>
>> Regards,
>> Steve
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/hVwd2352W4IJ.
>
> 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.

-- 
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 and PHP webhosting in Germany

2012-06-16 Thread sjtirtha
thank you carlos. For me the options are only virtual server and
webhosting, because the other i.e. root server is too expensive.
In webhosting, if it supports python. Does it mean I can install
django without any problem?

On Sat, Jun 16, 2012 at 10:47 PM, Carlos Daniel Ruvalcaba Valenzuela
<clsdan...@gmail.com> wrote:
> Try Hetzner in Germany, they are a solid hosting company with
> reasonable prices, their dedicated hardware is well know for being a
> great value.
>
> http://www.hetzner.de/
>
> On Sat, Jun 16, 2012 at 1:24 PM, sjtirtha <sjtir...@gmail.com> wrote:
>> Hi,
>>
>> can somebody recommend a good and cheap web hosting for django and
>> php(wordpress)?
>> I'm looking something below 10 € monthly, only for small apps and blogs.
>>
>> Regards,
>> Steve
>>
>> --
>> 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.
>>
>
> --
> 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.
>

-- 
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 and PHP webhosting in Germany

2012-06-16 Thread sjtirtha
Hi,

can somebody recommend a good and cheap web hosting for django and
php(wordpress)?
I'm looking something below 10 € monthly, only for small apps and blogs.

Regards,
Steve

-- 
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: Multitenant in Django

2011-09-09 Thread sjtirtha
But I cannot set the SITE_ID in the settings.py right?
Because if one user set the SITE_ID = 1, then parallel another user
can set the SITE_ID = 2.
Because we only have one instance.

On the other hand I still want to use SITE_ID from the settings.py,
because using this I can call the models method without passing any
SITE_ID.



On Fri, Sep 9, 2011 at 7:58 PM, Eric Hutchinson
<eric.hutchin...@burgopakusa.com> wrote:
> you could write a middleware that looks at the request.META and
> inserts the correct id into the request?
>
> you won't be able to access it like you would with the
> settings.SITE_ID, but it should be a start
>
> On Sep 9, 5:02 am, sjtirtha <sjtir...@gmail.com> wrote:
>> Hi,
>>
>> I'm looking for the best solution to have a multitenant in django.
>> Site Framework is often mentioned support multitenant.
>> But site framework is developed for websites which have several static sites.
>>
>> What I' looking for now is multitenant and not multi site.
>> So I want to have the possibility, when a user register in my web app,
>> he/she can choose a subdomain.
>> For example: user A:http://a.mywebapp.com;user B:http://b.mywebapp.com.
>> So the number of subdomain is not static, it increases by the number of user.
>>
>> Currently, with the site framework, I'm able to separate the data by
>> adding SITE_ID as foreign key in all my model.
>> So the data for each user/subdomain are separated by SITE_ID. It works
>> very well.
>> I even enhanced the user by user profile with SITE_ID and the
>> authentication is also site specific. So a user can only login into
>> his/her SITE and see only his/her data, not from others.
>>
>> The problem now is, since the SITE_ID is defined static in
>> settings.py, for each user/subdomain I need a django instance with
>> different SITE_ID. So if I have 20 user/subdomain, it means I need 20
>> django instances.
>>
>> And I cannot (or it will be very complex) create automatically django
>> instance for each new registered user.
>>
>> Can someone share his opinion or experience how to handle this?
>>
>> Regards,
>> Steve
>
> --
> 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.
>
>

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



Multitenant in Django

2011-09-09 Thread sjtirtha
Hi,

I'm looking for the best solution to have a multitenant in django.
Site Framework is often mentioned support multitenant.
But site framework is developed for websites which have several static sites.

What I' looking for now is multitenant and not multi site.
So I want to have the possibility, when a user register in my web app,
he/she can choose a subdomain.
For example: user A: http://a.mywebapp.com; user B: http://b.mywebapp.com.
So the number of subdomain is not static, it increases by the number of user.

Currently, with the site framework, I'm able to separate the data by
adding SITE_ID as foreign key in all my model.
So the data for each user/subdomain are separated by SITE_ID. It works
very well.
I even enhanced the user by user profile with SITE_ID and the
authentication is also site specific. So a user can only login into
his/her SITE and see only his/her data, not from others.

The problem now is, since the SITE_ID is defined static in
settings.py, for each user/subdomain I need a django instance with
different SITE_ID. So if I have 20 user/subdomain, it means I need 20
django instances.

And I cannot (or it will be very complex) create automatically django
instance for each new registered user.

Can someone share his opinion or experience how to handle this?

Regards,
Steve

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

2011-08-25 Thread sjtirtha
Hi,

I'm looking a solution to have themes in django like in wordpress.
Currently, I'm starting implement it by myself. But I face some issue
namely.

In wordpress all themes files: php, html, css, javascript, images are in one
folder.
So we only need to upload these files in one folder and it works.

When I do the same in django, namely under my /templates folder I have
/myfirsttheme folder which contains all files for the theme, incl. css.
But accessing the css does not work. So I copied the css to my /static
folder as well.

How can I set django to access the css, javascript, image files from my
/myfirstthme folder?

regards
Steve

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



Understanding of File Upload in Django

2009-12-13 Thread sjtirtha
Hi,

can somebody explain me how file upload works in Django?
I read this documentation:
http://docs.djangoproject.com/en/dev/topics/http/file-uploads/

And there is this part:
###
Where uploaded data is
stored¶

Before you save uploaded files, the data needs to be stored somewhere.

By default, if an uploaded file is smaller than 2.5 megabytes, Django will
hold the entire contents of the upload in memory. This means that saving the
file involves only a read from memory and a write to disk and thus is very
fast.

###

What does it mean by "saving the file involves only read from memory and a
write to disk..."?
I though uploading and saving a file are one process. When I upload a file
by submiting my form it means it will also save the file somewhere.

But what I understand from the documentation is uploading and saving are two
different processes. How can I trigger the saving then?


Regards,

Steve

--

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




Re: Django and CouchDB

2009-08-18 Thread sjtirtha
Yes,

I do have interest to help on Object non-Relational Mapper.
Does Django has a kind of interfaces, where I can implement my own Object
non-Relational Mapper and inject it to Django?

Regards,
Steve



On Tue, Aug 18, 2009 at 3:17 PM, Russell Keith-Magee <freakboy3...@gmail.com
> wrote:

>
> On Tue, Aug 18, 2009 at 7:40 PM, Joshua Partogi<joshua.part...@gmail.com>
> wrote:
> >
> >
> > On Tue, Aug 18, 2009 at 8:17 PM, sjtirtha <sjtir...@gmail.com> wrote:
> >>
> >> Hi,
> >>
> >> i found some Python API to access couchDB.
> >> I'm asking here for experience.
> >
> > Django model is really tight to RDBMS. You are going to have a hard time
> > making django model work with non-RDBMS
>
> This isn't entirely correct. Django's ORM is in no way tied to
> relational databases. Look at the public API for the ORM - the
> interface that is provided is object based, not relational. You don't
> call "SELECT * FROM table", you call Model.objects.all()
>
> Django's ORM doesn't currently have any non-relational
> implementations, so in practice, for newcomers (such as the original
> poster), this means that it isn't currently trivial to use a
> non-relational store with Django's ORM.
>
> The key word in that sentence is _currently_. The ORM has been
> specifically designed to accommodate non-relational data stores. There
> have been several recent discussions on adding a Google AppEngine or
> Amazon SimpleDB 'database backend'. CouchDB could also fall under this
> umbrella.
>
> Building these backends won't be trivial, and may require some minor
> modifications to the existing Django code, but they are certainly
> possible in the gross framework that has been provided. If you want to
> help out Django and you have interest and expertise in a particular
> non-relational datastore, this would be a great way to get involved.
>
> Yours,
> Russ Magee %-)
>
> >
>

--~--~-~--~~~---~--~~
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 and CouchDB

2009-08-18 Thread sjtirtha
Hi,

i found some Python API to access couchDB.
I'm asking here for experience.

Regards,
Steve

On Tue, Aug 18, 2009 at 5:08 AM, 邓超 <knifew...@gmail.com> wrote:

> You can google it. I have read once, but forget the link address now.
>
> 2009/8/18 sjtirtha <sjtir...@gmail.com>
>
> Hi,
>>
>> can some body share about his experience using Django and CouchDB?
>> I found some python API that can be used to access CouchDB, which one is
>> the best and suitable to Django Framework.
>>
>> Regards,
>> STeve
>>
>>
>>
>
>
> --
> Deng Chao
>
> >
>

--~--~-~--~~~---~--~~
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 and CouchDB

2009-08-17 Thread sjtirtha
Hi,

can some body share about his experience using Django and CouchDB?
I found some python API that can be used to access CouchDB, which one is the
best and suitable to Django Framework.

Regards,
STeve

--~--~-~--~~~---~--~~
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: Code generation

2009-08-09 Thread sjtirtha
Hi Joshua,

thank you for your response.
It means the statement:

"With that, you've got a free, and rich, *Python
API*<http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries>to
access your data. The API is created on the fly, no code generation"

in http://docs.djangoproject.com/en/dev/intro/overview/, does not mean that
django generate the code on the fly, but it has a generic API
implementation.

However, I'm more interessted, how manage.py generate the SQL, setting.py,
etc.
Does django ever able to generate code skeleton like Rails does?

Regards,

Steve
On Sun, Aug 9, 2009 at 3:09 PM, Joshua Partogi <joshua.part...@gmail.com>wrote:

> Python Metaclass is the keyword.
>
>
> On Sun, Aug 9, 2009 at 10:59 PM, sjtirtha <sjtir...@gmail.com> wrote:
>
>> And it is also mentioned in
>> http://docs.djangoproject.com/en/dev/intro/overview/
>> That Django generates the Model API on the fly. How can we generate code
>> on the fly in python?
>>
>> steve
>>
>>
>> On Sun, Aug 9, 2009 at 2:56 PM, sjtirtha <sjtir...@gmail.com> wrote:
>>
>>> Hi,
>>>
>>> does anybody now, how django generates the code?
>>> Is it documented some where? I read somewhere that Django uses Cheetah to
>>> generate code. But in other website, Guido compares Django template and
>>> cheetah.
>>>
>>> Regards,
>>> Steve
>>>
>>
>
> --
> http://blog.scrum8.com
> http://twitter.com/scrum8
>
> >
>

--~--~-~--~~~---~--~~
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: Code generation

2009-08-09 Thread sjtirtha
And it is also mentioned in
http://docs.djangoproject.com/en/dev/intro/overview/
That Django generates the Model API on the fly. How can we generate code on
the fly in python?

steve

On Sun, Aug 9, 2009 at 2:56 PM, sjtirtha <sjtir...@gmail.com> wrote:

> Hi,
>
> does anybody now, how django generates the code?
> Is it documented some where? I read somewhere that Django uses Cheetah to
> generate code. But in other website, Guido compares Django template and
> cheetah.
>
> Regards,
> Steve
>

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



Code generation

2009-08-09 Thread sjtirtha
Hi,

does anybody now, how django generates the code?
Is it documented some where? I read somewhere that Django uses Cheetah to
generate code. But in other website, Guido compares Django template and
cheetah.

Regards,
Steve

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



Exception Value: coercing to Unicode: need string or buffer, ContentType found

2009-07-20 Thread sjtirtha
Hi,

I got this error below. Can anybody help me? I don't know what causes the
error.
It happens when I add new FilmPerson entry in Admin Interface

class ContentAssoc(models.Model):
object_a = models.PositiveIntegerField()
type_a = models.ForeignKey(ContentType, related_name='type_a')
object_b = models.PositiveIntegerField()
type_b = models.ForeignKey(ContentType, related_name='type_b')

class Meta:
unique_together = ('object_a', 'type_a', 'object_b', 'type_b')


def __unicode__(self):
return self.type_a

class FilmPerson(ContentAssoc):
order = models.PositiveIntegerField()
as_person = models.CharField(max_length=100, null=True)
def getFilm(self):
filmList = Film.objects.get(id=self.object_a)
film = filmList.get()
return film
def getPerson(self):
personList = Person.object.get(id=self.object_b)
person = personList.get()
return person

## ERROR ###
Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/film/filmperson/add/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'x.common',
 'x.person',
 'x.film',
 'x.media']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')


Traceback:
File "C:\Python25\lib\site-packages\django\core\handlers\base.py" in
get_response
  86. response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Python25\lib\site-packages\django\contrib\admin\sites.py" in root
  157. return self.model_page(request, *url.split('/', 2))
File "C:\Python25\lib\site-packages\django\views\decorators\cache.py" in
_wrapped_view_func
  44. response = view_func(request, *args, **kwargs)
File "C:\Python25\lib\site-packages\django\contrib\admin\sites.py" in
model_page
  176. return admin_obj(request, rest_of_url)
File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" in
__call__
  191. return self.add_view(request)
File "C:\Python25\lib\site-packages\django\db\transaction.py" in
_commit_on_success
  238. res = func(*args, **kw)
File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" in
add_view
  499. self.log_addition(request, new_object)
File "C:\Python25\lib\site-packages\django\contrib\admin\options.py" in
log_addition
  294. object_repr = force_unicode(object),
File "C:\Python25\lib\site-packages\django\utils\encoding.py" in
force_unicode
  49. s = unicode(s)

Exception Type: TypeError at /admin/film/filmperson/add/
Exception Value: coercing to Unicode: need string or buffer, ContentType
found

--~--~-~--~~~---~--~~
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: Model Validation

2009-07-19 Thread sjtirtha
I just found the error.
This is the correct code
class AbstractContent(models.Model):
viewed   = models.PositiveIntegerField(max_length=7, blank=True,
null=True)
#rating   =
#ranking  =
created_by   = models.ForeignKey(User,
related_name="%(class)s_created_by")
changed_by= models.ForeignKey(User,
related_name="%(class)s_changed_by")
created_at   = models.DateTimeField(auto_now_add=True)
changed_at   = models.DateTimeField(auto_now=True, blank=True,
null=True)

class Meta:
abstract = True

Thanks for response

On Sun, Jul 19, 2009 at 10:23 PM, sjtirtha <sjtir...@gmail.com> wrote:

> Hi,
>
> I did by mistake copy and paste the coding from my editor.
> But in my coding it is "User". Still I have the same error.
>
> Steve
>
>
> On Sun, Jul 19, 2009 at 12:36 AM, Joshua Russo <josh.r.ru...@gmail.com>wrote:
>
>> On Sat, Jul 18, 2009 at 9:03 PM, sjtirtha <sjtir...@gmail.com> wrote:
>>
>>> class AbstractContent(models.Model):
>>> viewed   = models.PositiveIntegerField(max_length=7,
>>> blank=True, null=True)
>>> #rating   =
>>> #ranking  =
>>> created_by   = models.ForeignKey(User)
>>> changedBy= models.ForeignKey(Use, related_name='_changedBy')
>>> created_at   = models.DateTimeField(auto_now_add=True)
>>> changed_at   = models.DateTimeField(auto_now=True, blank=True,
>>> null=True)
>>>
>>> class Meta:
>>> abstract = True
>>>
>>
>> Looks like you misspelled User (as Use) for the ChangedBy field
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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: Model Validation

2009-07-19 Thread sjtirtha
Hi,

I did by mistake copy and paste the coding from my editor.
But in my coding it is "User". Still I have the same error.

Steve

On Sun, Jul 19, 2009 at 12:36 AM, Joshua Russo <josh.r.ru...@gmail.com>wrote:

> On Sat, Jul 18, 2009 at 9:03 PM, sjtirtha <sjtir...@gmail.com> wrote:
>
>> class AbstractContent(models.Model):
>> viewed   = models.PositiveIntegerField(max_length=7,
>> blank=True, null=True)
>> #rating   =
>> #ranking  =
>> created_by   = models.ForeignKey(User)
>> changedBy= models.ForeignKey(Use, related_name='_changedBy')
>> created_at   = models.DateTimeField(auto_now_add=True)
>> changed_at   = models.DateTimeField(auto_now=True, blank=True,
>> null=True)
>>
>> class Meta:
>> abstract = True
>>
>
> Looks like you misspelled User (as Use) for the ChangedBy field
>
> >
>

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



Model Validation

2009-07-18 Thread sjtirtha
Hi,

I try to call manage.py syncdb for my models, but I always get error
Lasttime, I solve the problem, by defining related_name for changedBy
attribute.
But now, I got the same problem after I define the model as abstract.

Error: One or more models did not validate:
person.person: Accessor for field 'changedBy' clashes with related field
'User._
changedBy'. Add a related_name argument to the definition for 'changedBy'.
person.person: Reverse query name for field 'changedBy' clashes with related
fie
ld 'User._changedBy'. Add a related_name argument to the definition for
'changed
By'.
film.film: Accessor for field 'changedBy' clashes with related field
'User._chan
gedBy'. Add a related_name argument to the definition for 'changedBy'.
film.film: Reverse query name for field 'changedBy' clashes with related
field '
User._changedBy'. Add a related_name argument to the definition for
'changedBy'.

Here is my model:
class AbstractContent(models.Model):
viewed   = models.PositiveIntegerField(max_length=7, blank=True,
null=True)
#rating   =
#ranking  =
created_by   = models.ForeignKey(User)
changedBy= models.ForeignKey(Use, related_name='_changedBy')
created_at   = models.DateTimeField(auto_now_add=True)
changed_at   = models.DateTimeField(auto_now=True, blank=True,
null=True)

class Meta:
abstract = True

class Person(AbstractContent):
GENDER_TYPE = (
  ('MALE','Male'),
  ('FEMALE','Female')
  )

first_name = models.CharField(max_length=20)
middle_name = models.CharField(max_length=20, blank=True)
last_name = models.CharField(max_length=20)
gender = models.CharField(max_length=6, choices=GENDER_TYPE)
birth_date = models.DateField(blank=True)
birth_country = models.CharField(max_length=20, blank=True)
birth_city = models.CharField(max_length=20, blank=True)
height = models.PositiveIntegerField(max_length=3, blank=True,
null=True)
weight = models.PositiveIntegerField(max_length=3, blank=True,
null=True)
def __unicode__(self):
return self.last_name

--~--~-~--~~~---~--~~
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: Basic AJAX (was: Re: multi applications)

2009-07-14 Thread sjtirtha
Hi,

thank you for the explanation. I'll look into it.
I found also an ajax lib for Django, it is DAJAX.
Steve

On Tue, Jul 14, 2009 at 10:09 PM, Shawn Milochik <shawn.m...@gmail.com>wrote:

>
>
> On Jul 14, 2009, at 3:43 PM, sjtirtha wrote:
>
> > Thank you for the explanation.
> > This helps me very much.
> >
> > You mentions about handling the smaller apps on the page with AJAX.
> > Is there any basic functionality to do this from Django Framework?
> > Or do you have any ajax lib/framework as preference?
> >
> > Steve
> 
>
> Use jQuery -- it'll automate most of it.
>
> Here are two simple samples. Both are in the $(document).ready()
> function. Once you use jQuery for about three minutes, you'll know
> what that is.
>
>This does a GET request to get a user's current balance.
>It then writes the balance (returned as JSON by the view)
>into the HTML div with the id current_balance.
>
>$.get("/balance_json/{{ch.slug}}", {}, function (data){
>$('#current_balance').html("$" + data.balance);
>}, 'json');
>
>
>This does a POST to submit a form to send an SMS message. The view
> also returns
>JSON in this case, (created from a Python dictionary), which will
> have a key of 'success'
>with a value of the success message, or a key of 'failure' with an
> error message in it.
>
> $("#sms_form").submit(function(event){
> event.preventDefault();  // stop the form from submitting and
> refreshing the page
> var data = $("#sms_form").serialize()
>
> // now send the data to the server via AJAX
> $.post("/patient/{{ch.slug}}/sms/", data, function(resp){
> if(resp.success) {
> $("#messages").html(" class='success'>" + resp.success + "");
> $("#success-message").animate({ backgroundColor:
> "#E6EFC2" }, 2000);
> update_activity();
> } else if (resp.fail) {
> $("#messages").html(" class='fail'>" + resp.fail + "");
> $("#fail-message").animate({ backgroundColor:
> "#fbe3e4" }, 2000);
> }
> }, "json");
> });
>
> I don't know if there are are super-special Django tools to do AJAX,
> but as it's JavaScript and Django's Python, I doubt it.
>
> The most useful things in Django are simplejson and safestring (both
> in django.utils). You'll need simplejson to easily dump a dictionary
> into a JSON string to pass back to JavaScript, and you'll need
> safestring to "mark_safe" JSON strings you're going to pass via the
> context to be rendered within the templates. Otherwise they'll be
> escaped automatically for your protection.
>
> 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
-~--~~~~--~~--~--~---



Re: multi applications

2009-07-14 Thread sjtirtha
Thank you for the explanation.
This helps me very much.

You mentions about handling the smaller apps on the page with AJAX. Is there
any basic functionality to do this from Django Framework?
Or do you have any ajax lib/framework as preference?

Steve

On Tue, Jul 14, 2009 at 9:10 PM, Shawn Milochik <shawn.m...@gmail.com>wrote:

>
>
> On Jul 14, 2009, at 2:57 PM, sjtirtha wrote:
>
> > Hi,
> >
> > I'm looking for documentation, which describes how to build a web
> > application which includes many other applications.
> > For example like Facebook, it has following applications on the
> > first screen:
> > 1. On the left side is dynamic menu
> > 2. In the middle is the microblogging
> > 3. On the right side on the top is Request block
> > 4. On the right side in the middle is Highlights
> >
> > How can I build a web application like this? I was thinking to have
> > a main application which has a template that includes all other
> > applications.
> > But how can I set the context specific for every templates of the
> > included applications?
> >
> > regards,
> >
> > Steve
>
>
> There are several different aspects to what you are asking for and
> describing. The first part is showing all the apps within one page,
> and that's just a matter of a well-formatted CSS/HTML template. This
> template may (should?) include smaller templates (for each section).
>
> Ultimately your page will be called by a single URL, so you'll receive
> the entire request in one place. From there, you will have to decide
> how to handle the contexts. Look into the RequestContext class. The
> things you need to display on all pages, regardless of what the "main"
> view is at the moment, can be moved over there to avoid clutter.
>
> The "main" content could be handled in the view called directly by
> urls.py, and the rest can be inherited from the context dictionary
> keys coming from your request contexts.
>
> Also, you'll probably want/need to handle all the smaller apps on the
> page with AJAX, because you won't want to refresh the entire page for
> updating the microblog, etc. And since you're referring to FaceBook,
> they even do most of the processing of actions in the "main" section
> with AJAX, just to have a smoother user experience.
>
> These are certainly vague answers. If this isn't what you're asking
> for, please provide more detail.
>
> 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
-~--~~~~--~~--~--~---



multi applications

2009-07-14 Thread sjtirtha
Hi,

I'm looking for documentation, which describes how to build a web
application which includes many other applications.
For example like Facebook, it has following applications on the first
screen:
1. On the left side is dynamic menu
2. In the middle is the microblogging
3. On the right side on the top is Request block
4. On the right side in the middle is Highlights

How can I build a web application like this? I was thinking to have a main
application which has a template that includes all other applications.
But how can I set the context specific for every templates of the included
applications?

regards,

Steve

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



MEDIA_URL and ADMIN_MEDIA_PREFIX

2009-07-12 Thread sjtirtha
Hi,

I found out that MEDIA_URL and ADMIN_MEDIA_PREFIX may not have the same
value, otherwise images that is located in this MEDIA_URL cannot be
displayed in browser.
I did not found about this anywhere in the documentation. Is my assumption
correct?

Regards,
Steve

--~--~-~--~~~---~--~~
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 validating the model

2009-07-10 Thread sjtirtha
Hi,

I have a problem calling manage.py syncdb for my models.
Here is my models:
from django.db import models
from django.contrib.auth.models import User

# Create your models here.
class DocumentType(models.Model):
name = models.CharField(max_length=20, unique=True)
description  = models.CharField(max_length=200)
assignedType = models.ForeignKey('self')

class Category(models.Model):
name= models.CharField(max_length=20, unique=True)
type= DocumentType()
relatedCategories = models.ForeignKey('self',
related_name='relatedCategories')
description  = models.CharField(max_length=200)

class Document(models.Model):
type = DocumentType()
viewed   = models.PositiveIntegerField(max_length=7)
#rating   =
#ranking  =
created_by   = User()
changed_by   = User()
created_at   = models.DateTimeField()
changed_at   = models.DateTimeField()
categories= models.ManyToManyField(Category,
related_name='categories')  #n to m relationship
assignedDocuments = models.ForeignKey('self',
related_name='assignedDocuments')
parentDocument = models.ForeignKey('self',
related_name='parentDocument')#1 to n relationship

The error that I got is:
Error: One or more models did not validate:
common.category: Accessor for field 'relatedCategories' clashes with field
'Category.relatedCategories'. Add a related_name argument to the definition
for 'relatedCategories'.
common.category: Reverse query name for field 'relatedCategories' clashes
with field 'Category.relatedCategories'. Add a related_name argument to the
definition for 'relatedCategories'.
common.document: Accessor for field 'assignedDocuments' clashes with field
'Document.assignedDocuments'. Add a related_name argument to the definition
for 'assignedDocuments'.
common.document: Reverse query name for field 'assignedDocuments' clashes
with field 'Document.assignedDocuments'. Add a related_name argument to the
definition for 'assignedDocuments'.
common.document: Accessor for field 'parentDocument' clashes with field
'Document.parentDocument'. Add a related_name argument to the definition for
'parentDocument'.
common.document: Reverse query name for field 'parentDocument' clashes with
field 'Document.parentDocument'. Add a related_name argument to the
definition for 'parentDocument'.

What is wrong with my model.

Regards,
Steve

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



Multi-Table Inheritance Performance

2009-07-09 Thread sjtirtha

Hi,

I see that in Django  I'm able to define a model inheritance, which
later will be also applied to generate the DB tables by using Multi-
Table Inheritance. This will result 2 database tables, from super
class and subclass. This is good from design perspective.
But how about here the performance, because when I access the subclass
DB table I need also access the super class DB table.

When it is better to use abstract inheritance in respect to
performance issue?

Steve
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Model Inheritance

2009-07-09 Thread sjtirtha

Hi,

I'm new in Django and now I'm already facing the issue with Model
Inheritance.
Here is my imagination, how the model should like

class Document(models.Model):
   name = ...
   type   = 


class Media(Document):
   link = 
   type = 
   class Meta:
   abstract = True

class Image(Media):
size = .

Is this Model possible? It should only generate two DB tables
(Document and Image), where Image inherits the attributes from Media.

Steve

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