App engine serving static files?

2011-02-15 Thread Praveen Krishna R
*Hey Guys,*
*
*
*Does Anyone has experience, serving static content with google app engine?*
*Does it make a big difference, than serving it with nginx on the same
server as django?*
*I currently use a shared hosting, and was just thinking to move the static
content to GAE*
*I would like to know your thoughts on this*
*
*
-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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: User Profiles?

2011-02-15 Thread william ratcliff
Thanks!

On Wed, Feb 16, 2011 at 1:43 AM, Ian Clelland  wrote:

> >
> user=User.objects.create_user(username=username,email=email,password=password)
> >except django.db.utils.IntegrityError:
> >print 'user exists'
> >user=User.objects.get(username=username)
> >user.firstname=first_name
> >user.lastname=last_name
> >user.save() #make sure we have the user before we fiddle around
> > with his name
> >#up to here, things work.
> >user.profile.age=34
> >user.save()
>
> > The question is, why doesn't the age update?
>
> This doesn't do what you are expecting, simply because saving the user
> object is different from saving the profile object. (user.save() just
> updates a row in the auth_user table, which doesn't affect the
> accounts_userprofile table at all.)
>
> The way I would do it is this:
>
> profile = user.get_profile()
> profile.age = 34
> profile.save()
>
> Try that, and see if it updates the database.
>
> --
> Regards,
> Ian Clelland
> 
>
> --
> 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.



Re: User Profiles?

2011-02-15 Thread Ian Clelland
> user=User.objects.create_user(username=username,email=email,password=password)
>    except django.db.utils.IntegrityError:
>        print 'user exists'
>        user=User.objects.get(username=username)
>    user.firstname=first_name
>    user.lastname=last_name
>    user.save() #make sure we have the user before we fiddle around
> with his name
>    #up to here, things work.
>    user.profile.age=34
>    user.save()

> The question is, why doesn't the age update?

This doesn't do what you are expecting, simply because saving the user
object is different from saving the profile object. (user.save() just
updates a row in the auth_user table, which doesn't affect the
accounts_userprofile table at all.)

The way I would do it is this:

profile = user.get_profile()
profile.age = 34
profile.save()

Try that, and see if it updates the database.

-- 
Regards,
Ian Clelland


-- 
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: gantt charts or timeline graphics

2011-02-15 Thread Xavier Ordoquy
Hi,

Doesn't reportlab already provide imaging facilities that you are looking for ?

Regards,
Xavier.


Le 16 févr. 2011 à 00:33, refreegrata a écrit :

> Hello list, I have a question. I need to generate some gantt chart or
> time line image to represent every step of an element in a process. I
> already have saved the history, but I need represent this in a
> graphic. Somebody know some library to do something like this? The
> idea is build the graphic in the server side, because I need display
> the image in the html template and also must to be exportable to a
> report PDF(reportlab).
> 
> Any suggestion be grateful.
> 
> Thanks for read, and sorry for my poor english.

-- 
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: form select box how to (help needed)

2011-02-15 Thread Kenneth Gonsalves
On Tue, 2011-02-15 at 19:05 -0800, Bobby Roberts wrote:
> I can't load it through the "CHOICES" parameter in my forms field...
> how can I do this? 

override __init__ in your form and populate there
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



Re: chrome extension

2011-02-15 Thread Tony Lambropoulos
Should I assume that this was a silly question?

On Mon, Feb 14, 2011 at 10:10 PM, Tony  wrote:

> Hi,
> Is there any way to have a chrome extension with a backend in Django,
> like for storing data server side and using its views?  Or is this not
> possible?
> thanks
>
> --
> 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.



RE: Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-15 Thread Chris Matthews
Hi Hank,

I just got the book "jQuery UI 1.7" by Dan Wellman. Chapter 8 covers 
Progressbar. Have not worked through it yet so I can't give my view on it.

Regards
Chris

-Original Message-
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of hank23
Sent: 16 February 2011 00:27
To: Django users
Subject: Re: Progress Bar/ProgressBarUploadHandler Documentation Examples

Are there any other good options or coding examples besides this one
or is it the best and most complete?

On Feb 15, 8:20 am, Derek  wrote:
> Fortunately, other clever coders have written up on 
> this:http://fairviewcomputing.com/blog/2008/10/21/ajax-upload-progress-bar...
>
> On Feb 14, 4:56 pm, hank23  wrote:
>
>
>
> > Are there any exampels of how to code Progress bars or the handlers
> > which support them somewhere in the django documentation? they're
> > referenced in the documentation, but without showing any actual coding
> > examples.- Hide quoted text -
>
> - Show quoted text -

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



form select box how to (help needed)

2011-02-15 Thread Bobby Roberts
I've got several select boxes in a user profile that the we can
manipulate in /admin.  One of these select boxes is called "locations"
and has locations to which you can assign a user.

for explanation, let's say that that the select box is populated like
such:


1,location1
2,location2
3,location3
4,location4

where the numbers are the option values and the text is the option
text.

In this user profile, if they choose ocation1,location2,location3, it
saves to a session variable as "1,2,3" (and of course also saves in
their profile.)

so far so good.


now here's what i need help with.

On the public side of the site, they'll login and do certain things.
i want to have a select box (as previously described), HOWEVER, i only
want it populated with options 1,2 and 3 (the values in their session
variable)... not the 4th location since they haven't been assigned to
that location.


I can't load it through the "CHOICES" parameter in my forms field...
how can I do this?

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



User Profiles?

2011-02-15 Thread William Ratcliff
In Django, the standard way to add additional information to be
associated with a user is to use a user profile. To do this, I have an
app called, "accounts"

accounts
   __init__.py
   models.py
   admin.py  (we'll ignore this for now, it works fine) 
   management
__init__.py
commands
 __init__.py
 generate_user.py
in settings.py we have AUTH_PROFILE_MODULE = 'accounts.UserProfile'

in models.py we have

from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
age=models.IntegerField()
extra_info=models.CharField(max_length=100,blank=True)
User.profile = property(lambda u:
UserProfile.objects.get_or_create(user=u)[0])
The last line makes use of python decorators to either get a user
profile object if it already exists, or to return an existing one.
This code is taken from: 
http://www.turnkeylinux.org/blog/django-profile#comment-7262

Next, we need to try to make our simple command. So in gen_user.py

from django.core.manaement.base import NoArgsCommand
from django.db import models
from django.contrib.auth.models import User
from accounts.models import UserProfile
import django.db.utils


class Command(NoArgsCommand):
help='generate test user'
def handle_noargs(self, **options):
first_name='bob'; last_name='smith'
username='bob' ; email='b...@bob.com'
password='apple'
#create or find a user
try:
 
user=User.objects.create_user(username=username,email=email,password=password)
except django.db.utils.IntegrityError:
print 'user exists'
user=User.objects.get(username=username)
user.firstname=first_name
user.lastname=last_name
user.save() #make sure we have the user before we fiddle around
with his name
#up to here, things work.
user.profile.age=34
user.save()
#test_user=User.objects.get(username=username)
#print 'test', test_user.profile.age
#test_user.profile.age=23
#test_user.save()
#test_user2=User.objects.get(username=username)
#print 'test2', test_user2.profile.age
to run, from your project directory, type python manage.py gen_user

The question is, why doesn't the age update? I suspect that this is a
case of me catching an instance instead of the real object, bet
everything that I've tried from using user.userprofile_set.create to
using setattr, etc. has failed and I'm running out of ideas. Is there
a better pattern? Ideally, I would like to just be able feed in a dict
to update the userprofile, but for now, I can't see how to even update
a single parameter. Also, even when I have been able to create a user
with one parameter (the age, which is required), I have not been able
to later update the additional parameter. I can't remove or delete the
old userprofile and blast in a new one because of the foreignkey
relation.

Ideas? Thanks

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



how to get attribute of intermediary model?

2011-02-15 Thread Margie Roginski
Say I am using an intermediary model like that in the doc:

class Person(models.Model):
name = models.CharField(max_length=128)

class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through='Membership')

class Membership(models.Model):
person = models.ForeignKey(Person)
group = models.ForeignKey(Group)
date_joined = models.DateField()

For a given group, say I want to go through the persons in the group
and print the date each joined the group.

beatles = Group.objects.get(name="beatles")
for person in group.members.all():
   # get join date for person

What's the best way to do this?  It seems to me that I have to add a
related_name to the person field of Membership like this:

person = models.ForeignKey(Person, related_name="memberships")

and then traverse backward from the person back to the membership,
filtering to find the correct membership based on the group name.  Can
someone tell me if there is a better way?  So I'm thinking I have to
do this:

beatles = Group.objects.get(name="beatles")
for person in group.members.all():
  joinDate = person.memberships.filter(group_name="beatles")
[0].date_joined

Thanks for any pointers,

Margie

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



Dajaxice Unresolved Import

2011-02-15 Thread LJ
I followed the installation instructions on the dajaxice project
website (http://docs.dajaxproject.com/dajaxice/installation.html).
Some parts of the simple example project work great, but some parts do
not work.  I am getting the error:
Unresolved import: dajaxice_autodiscover
This is on the line that imports dajaxice_autodiscover in urls.py:
from dajxice.core import dajaxice_autodiscover

I am curious to know if I have installed the wrong version of python-
django-dajaxice or python-django-dajax.
I just used the Synaptic Package Manager to install these so I have
version 0.1.5-1 of python-django-dajaxice, and version 0.8.4-1 of
python-django-dajax.

Does anyone know if it matters what version I install of these
packages?
(I'm using version 2.6.6 of python and 1.2.3-1ubuntu0.2.10.10.1 of
python-django.)

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



gantt charts or timeline graphics

2011-02-15 Thread refreegrata
Hello list, I have a question. I need to generate some gantt chart or
time line image to represent every step of an element in a process. I
already have saved the history, but I need represent this in a
graphic. Somebody know some library to do something like this? The
idea is build the graphic in the server side, because I need display
the image in the html template and also must to be exportable to a
report PDF(reportlab).

Any suggestion be grateful.

Thanks for read, and sorry for my poor english.

-- 
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: Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-15 Thread hank23
Are there any other good options or coding examples besides this one
or is it the best and most complete?

On Feb 15, 8:20 am, Derek  wrote:
> Fortunately, other clever coders have written up on 
> this:http://fairviewcomputing.com/blog/2008/10/21/ajax-upload-progress-bar...
>
> On Feb 14, 4:56 pm, hank23  wrote:
>
>
>
> > Are there any exampels of how to code Progress bars or the handlers
> > which support them somewhere in the django documentation? they're
> > referenced in the documentation, but without showing any actual coding
> > examples.- Hide quoted text -
>
> - Show quoted text -

-- 
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: Authentication Framework Question

2011-02-15 Thread hank23
Thanks a bunch. It looks like its all there. Thanks again!!

On Feb 15, 1:59 pm, Shawn Milochik  wrote:
> See the 'next' stuff:
>
> http://docs.djangoproject.com/en/1.2/topics/auth/

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



oauth & django for a private server

2011-02-15 Thread Ruben Benarroch
hi, i am developing an application for my university, they asked me
for an authentication logarithm, in this case OAUTH to be the one who
authenticates the web application that im developing which will show
the schedule for the students and teachers, im in need of a good
tutrotial for developing ann app with oauth autentication but for
internal autehnticacion not for any social network, and it must be on
a django framework...
sorry for my english, im from caracas venezuela

-- 
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: Accessing the HttpRequest object from a model

2011-02-15 Thread Daniel Roseman

On Tuesday, February 15, 2011 8:05:31 PM UTC, jonas wrote:
>
> Thanks for your reply. But I found out about save_model().
> From there I have access to the HttpRequest object that contains my 
> contrib.auth.models.User model.
>
> But that seemed to be half the story. 
>
> class Post(models.Model):
> def save_model(self, req, obj, form, change):
> if self.author is None:
> self.author = req.User
>
> Doesn't seem to do the trick. I'm getting error reports telling me 
> author_id can't be null.
> And indeed if  I look in my mysql database I see a author_id column and no 
> author column. Makes sence since author is of the type models.ForeignKey().
>
> Anyway how do I get around this ?
>
> Regards,
>
> Jonas.
>

It doesn't work because that code isn't getting run at all, as you'll see if 
you put debugging into it.

save_model is an admin method, on the ModelAdmin class. It's not a method on 
the model class, and won't work outside of the admin. Tom has already given 
you the correct solution.
--
DR.

-- 
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: Accessing the HttpRequest object from a model

2011-02-15 Thread Jonas Geiregat
>> 
> 
> Two ways:
> 
> 1) Pass the form which is creating/modifying this object the current
> request. It can then use the request object in the save() method to
> populate the field. Eg:
> 
> class FooForm(forms.ModelForm):
>  def __init__(self, *args, **kwargs):
>self.request = kwargs.pop('request')
>super(FooForm, self).__init__(*args, **kwargs)
>  def save(commit=False):
>foo = super(FooForm, self).save(commit=False)
>if not foo.user:
>  foo.user = request.user
>if commit:
>  foo.save()
>return foo
> 
> Even better would be to not pass around an opaque object which has
> magic data in it - if you need the current user to correctly create
> objects, then pass the user to the form which creates the objects.
> 
> 2) At the start of each request, store the current request in thread
> local storage[1], so that it is globally available everywhere.
> 
> You may have noticed I can knock out the implementation to 1) from
> rote, this is because this is the correct way of doing it. It's
> harder, more work, and doesn't 'just work', but it means you haven't
> tied your models to only working within the context of a web request.
> For instance, if you went the thread local route, and you wanted to
> run a management command to import data, you would have to prep thread
> local storage with a dummy 'request' object, providing the 'current
> user' to your scripts.
> 


Thanks for your reply. But I found out about save_model().
>From there I have access to the HttpRequest object that contains my 
>contrib.auth.models.User model.

But that seemed to be half the story. 

class Post(models.Model):
def save_model(self, req, obj, form, change):
if self.author is None:
self.author = req.User

Doesn't seem to do the trick. I'm getting error reports telling me author_id 
can't be null.
And indeed if  I look in my mysql database I see a author_id column and no 
author column. Makes sence since author is of the type models.ForeignKey().

Anyway how do I get around this ?

Regards,

Jonas.



-- 
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: Authentication Framework Question

2011-02-15 Thread Shawn Milochik
See the 'next' stuff:

http://docs.djangoproject.com/en/1.2/topics/auth/

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



Authentication Framework Question

2011-02-15 Thread hank23
I have an application and I have figured out how to always send an
unauthenticated user to the login screen, no matter what screen they
try to enter when they're unauthenticated. First let me say that I
have not finished reading all of the documenation on the
authentication framework yet, so if the answer to the following
question is there, I apologize. Just let me know that. My question is
is it possible to redirect the user, after they login, back to the
original screen that they tried to enter before they logged in? If so
can you show me an example, point me to documentation, or otherwise
explain how? Thanks.

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



request_finished signal

2011-02-15 Thread Bzyczek
Hello,
when exactly Django send request_finished signal please?

If I have in cache some temporary data, is it safe to clear them by
function connected to request_finished signal? (i suppose that
template was rendered, view and all middleware code was executed,
etc..; in short, everything which could touch cached values. we are
now just returning some html/text data to client).

Regards
Michal

-- 
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 Templates: Form field name as variable?

2011-02-15 Thread Mike Ramirez
On Tuesday, February 15, 2011 01:31:07 am ju wrote:
> Thank you very much for you answer
> 
> I prefer to use validation that form class provides for me...
> 

I do too. 


> I tried to use  but
> the other problem that I have is that I can't get errors for each
> field of form :(
> .  
> There is another solution that I decide to use:
> http://stackoverflow.com/questions/4993625/django-templates-form-field-name
> -as-variable

I like it too, but aren't you still stuck with validating it or are you 
applying a validator to each field you generate this way?


Mike
-- 
A physicist is an atom's way of knowing about atoms.
-- George Wald

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



really difficult issue for sorting a callable for a list_display

2011-02-15 Thread Dan Kirkland
I have two models:

callrecords
and
callbackrequest

Callrecords stores details of a customer.
Callackrequest stores dates and times of when we need to call the
customer back

So, if a customer calls we create a record in callrecords.  The
callrecords admin interface also has
  inlines = [CallBackInline]
This means the user can enter customer details for the callrecords
data as well as call back requests within the same page.

Now, the list_display for callrecords uses a callable to fetch the
last callback record (based on date of call back required):

   # next_call_back_due will return the maximum date/time for any
callbacks that exist against the customer
def next_call_back_due(self, obj):
# max_call_record =
CallBackRequest.objects.filter(CallRecord.id =
obj.id).filter(call_back_date=CallBackRequest.objects.filter(CallRecord.id=obj.id).aggregate(Max('call_back_date'))
['call_back_date__max'])
# callback_date = max_call_record.call_back_date
  call_records =
CallBackRequest.objects.filter(CallRecord=obj.id).order_by('-
call_back_date')
  if call_records.count() > 0:
  return call_records[0].call_back_date
  else:
 return None
# return callback_date


list_display = ('number', 'call_date', 'call_back_required',
'next_call_back_due')


the problem is, I really, really need the next_call_back_due date to
be sortable for the user - or at least if it can't be sortable by the
user, then the entire list should be ordered based on the
next_call_back_date.

I have tried a few things, including:
next_call_back_due.admin_order_field = 'call_back_date'

But that doesn't work.

This feature is really important for the users so any help would be
hugely appreciated.

Snipped of the models:

class CallBackRequest(models.Model):

CallRecord = models.ForeignKey(CallRecord, null=True)
call_back_date = models.DateTimeField(null=True, blank=True)
user = models.ForeignKey(User, null=True, blank=True)

class CallRecord(models.Model):

number = models.CharField(max_length=18, help_text="Please set to
the CLI of the premise  where Broadband is to be provided.")
call_date = models.DateTimeField(auto_now=True)
call_back_required = models.BooleanField(blank=True, default=True)

-- 
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: ID of each request

2011-02-15 Thread Bzyczek
Thank you for your tips, I will try it.

Michal

On 15 ún, 18:03, "Cal Leeming [Simplicity Media Ltd]"
 wrote:
> Well, as long as you are doing things correctly, then Python will be thread
> safe and thus you can place a "global" definition in your middleware (global
> grequest; grequest=request), then create a function which does "global
> grequest; return grequest". I have used this method for quite some time, and
> it has proven sound so far. This should also work incrementing values.
>
> If you want the incremented value to be across multiple deployments, you
> could use memcached (which supports atomic operations), then do grequest_inc
> = cache.incr('grequestcount', 1).
>
> Hope this makes sense!
>
>
>
>
>
>
>
> On Tue, Feb 15, 2011 at 4:58 PM, Bzyczek  wrote:
> > > I am not aware of anything, but you can easily make a piece of middleware
> > > which generated a UUID then exposed this in the request object :)
>
> > Yes I could, but then I must provide to all parts of my code request
> > object. I don't know how to build something like "global variable",
> > which will be safe regardless on server configuration (many
> > procesesses/threads of my app).
>
> > Michal
>
> > --
> > 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.



Re: Django User Permissions

2011-02-15 Thread David De La Harpe Golden
On 15/02/11 17:31, hank23 wrote:
> So my question is what type of object is returned by user.user_permissions?

First, N.B. you probably want to look at user.get_all_permissions().
user_permissions in particular doesn't represent all permissions a user
"has" in the django.contrib.auth system, only ones granted directly to
the user, not ones they have e.g. by way of group membership.

Anyway, to answer your question: User to Permission is a ManyToManyField

http://code.djangoproject.com/browser/django/trunk/django/contrib/auth/models.py#L218

There's involved stuff going on underneath for all such fields, but you
don't usually have to think about it - user.user_permissions winds up
being a specialized sort of Manager, with the usual manager methods -
user.user_permissions.all() etc. So the django docs for managers and
related fields apply:

http://docs.djangoproject.com/en/1.2/topics/db/managers/
http://docs.djangoproject.com/en/1.2/ref/models/relations/


> Or alternatively how can I code type check logic to figure out
> what type it is?

Python has various builtins, type(some.thing) among them.(and
dir(some.thing) will list an object's attrs). Refer to python docs, there.

But you might also want to install ipython if you haven't already.  It
provides a more full-featured interactive repl for python, that django
`./manage.py shell` will pick up and use automatically if present. Then
you can just type `some.thing?` at the shell find out all sorts of stuff
about some.thing, and have get tab completion of obj attrs and such.

http://ipython.github.com/ipython-doc/stable/html/interactive/reference.html#dynamic-object-information

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



Trouble Understanding best approach for using django authentication

2011-02-15 Thread Jeremiah
I'm struggling with getting/understanding the best approach for using
the authentication tools that come with Django.  I'm taking the
approach of writing my own form and my own view.  My form displays and
accepts input, but I'm not getting expected results once the "login"
button is clicked.  I'm sure I'm just not doing something exactly
right...

urls.py line:
(r'^accounts/login/$', login_page),
**
views.py line:
def login_page(request):
if request.method == 'POST':
form = LoginForm(request.POST)
if form.is_valid():
username = form.cleaned_data['email']
password = form.cleaned_data['password']
user = authenticate(username=username, 
password=password)
if user is not None:
if user.is_active:
login(request, user)
else:
raise forms.ValidationError("Inactive 
user.")
else:
raise forms.ValidationError("Invalid login 
credentials.")
else:
form = LoginForm()
variables = RequestContext(request, {'form': form})
return render_to_response('accounts/login.html', variables)
**
forms.py:
from django import forms
from django.contrib.auth.models import User

class LoginForm(forms.Form):
email   = forms.CharField(label=u'Email Address')
password= forms.CharField(
label=u'Password',
widget=forms.PasswordInput()
)
**

So when I go to the form url in the browser, I punch in some
information and click "login".  I see the exception for invalid
credentials.  What I'm not sure is...

Should I be raising an exception?
What is the correct way to inform of bad credentials?

I was looking at this url as inspiration:
http://docs.djangoproject.com/en/1.2/topics/auth/#authentication-in-web-requests

Can someone help guide me towards my obvious blunder?  (and maybe give
this beginner some pointers on custom auth views/forms vs using
default?)

Thank you,
Jeremiah

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



Looking for a python / Django tutor in the Bay Area

2011-02-15 Thread spaceshuttle
I am looking for someone who can work with me on a web application
that I started developing in Django, about 2 months ago. Looking for
someone local to the Bay Area, ideally around Palo-Alto / Mountain
View, for a weekly or bi-weekly meetings. I'm a beginner and am
looking for an experienced developer who knows Python and Django Very
well, but can also help me learn more general programming concepts, as
well as working with databases and web servers . If you happen to know
some JavaScript that'd be great - I need to use some for the front
end. Most importantly, you should be someone who loves teaching new
concepts. I can pay a fair, but not exorbitant, amount of money.
If interested, please write back or forward this to your friends.
Thanks in advance...
Na'ama

-- 
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 User Permissions

2011-02-15 Thread hank23
I'm trying to get used to working with django's user authentication
framework and want to display the permissions for a user I've created.
When I try to display the the permissions that I get back from
user.user_permissions I had assumed that something like a list would
be returned and be iterable, but it's neither. So my question is what
type of object is returned by user.user_permissions? Or alternatively
how can I code type check logic to figure out what type it is? Thanks
for the help.

-- 
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: ID of each request

2011-02-15 Thread Cal Leeming [Simplicity Media Ltd]
Well, as long as you are doing things correctly, then Python will be thread
safe and thus you can place a "global" definition in your middleware (global
grequest; grequest=request), then create a function which does "global
grequest; return grequest". I have used this method for quite some time, and
it has proven sound so far. This should also work incrementing values.

If you want the incremented value to be across multiple deployments, you
could use memcached (which supports atomic operations), then do grequest_inc
= cache.incr('grequestcount', 1).

Hope this makes sense!

On Tue, Feb 15, 2011 at 4:58 PM, Bzyczek  wrote:

> > I am not aware of anything, but you can easily make a piece of middleware
> > which generated a UUID then exposed this in the request object :)
>
> Yes I could, but then I must provide to all parts of my code request
> object. I don't know how to build something like "global variable",
> which will be safe regardless on server configuration (many
> procesesses/threads of my app).
>
> Michal
>
> --
> 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.



Re: ID of each request

2011-02-15 Thread Bzyczek
> I am not aware of anything, but you can easily make a piece of middleware
> which generated a UUID then exposed this in the request object :)

Yes I could, but then I must provide to all parts of my code request
object. I don't know how to build something like "global variable",
which will be safe regardless on server configuration (many
procesesses/threads of my app).

Michal

-- 
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: ID of each request

2011-02-15 Thread Cal Leeming [Simplicity Media Ltd]
I am not aware of anything, but you can easily make a piece of middleware
which generated a UUID then exposed this in the request object :)

On Tue, Feb 15, 2011 at 4:41 PM, Plovarna  wrote:

> Hello,
> is there something in core of the Django which uniquely identify each
> request? (something like variable, that is incremented on each request and I
> have access to value from any part of my application).
>
> Regards
> Michal
>
> --
> 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.



ID of each request

2011-02-15 Thread Plovarna
Hello,
is there something in core of the Django which uniquely identify each request? 
(something like variable, that is incremented on each request and I have access 
to value from any part of my application). 

Regards
Michal

-- 
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: Accessing the HttpRequest object from a model

2011-02-15 Thread Tom Evans
On Tue, Feb 15, 2011 at 3:58 PM, Jonas Geiregat  wrote:
> I have a model
>
> from django.contrib.auth.models import User
>
> class Post(models.Model):
>        with_some_properties = model.CharField(max_length=1)
>        author  = models.ForeignKey(User)
>
>        def clean(self):
>                if self.author is None:
>                        self.author = 
>
>
> When a post is saved I would like to bind the current logged in user the the 
> self.author field in the clean method.
> How could I accomplish this ?
>
> Regards,
>
> Jonas.
>

Two ways:

1) Pass the form which is creating/modifying this object the current
request. It can then use the request object in the save() method to
populate the field. Eg:

class FooForm(forms.ModelForm):
  def __init__(self, *args, **kwargs):
self.request = kwargs.pop('request')
super(FooForm, self).__init__(*args, **kwargs)
  def save(commit=False):
foo = super(FooForm, self).save(commit=False)
if not foo.user:
  foo.user = request.user
if commit:
  foo.save()
return foo

Even better would be to not pass around an opaque object which has
magic data in it - if you need the current user to correctly create
objects, then pass the user to the form which creates the objects.

2) At the start of each request, store the current request in thread
local storage[1], so that it is globally available everywhere.

You may have noticed I can knock out the implementation to 1) from
rote, this is because this is the correct way of doing it. It's
harder, more work, and doesn't 'just work', but it means you haven't
tied your models to only working within the context of a web request.
For instance, if you went the thread local route, and you wanted to
run a management command to import data, you would have to prep thread
local storage with a dummy 'request' object, providing the 'current
user' to your scripts.

Cheers

Tom

[1] http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

-- 
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: images

2011-02-15 Thread webzy
Hi,

Here is a How-to on this:
http://docs.djangoproject.com/en/1.2/howto/static-files/


On Feb 15, 12:00 pm, "Szabo, Patrick \(LNG-VIE\)"
 wrote:
> Hi,
>
> I just want an image to be shown in my header so i just added it in my
> template like this:
>
> 
>
> Unfortunately i only get the "alt text" shown and not the image.
> The image is in the same directory as the template.
>
> Why doesn't this work ?!
>
> Kind regards
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT-Entwickler
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146

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



Accessing the HttpRequest object from a model

2011-02-15 Thread Jonas Geiregat
I have a model

from django.contrib.auth.models import User

class Post(models.Model):
with_some_properties = model.CharField(max_length=1)
author  = models.ForeignKey(User)

def clean(self):
if self.author is None:
self.author = 


When a post is saved I would like to bind the current logged in user the the 
self.author field in the clean method.
How could I accomplish this ?

Regards,

Jonas.

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



AW: list to template

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
No of course it's not a joke...it really isn't
I guess i just missunderstood. 

But still {{ buchung.0.0 }} doesn't work either


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Dienstag, 15. Februar 2011 16:05
An: django-users@googlegroups.com
Betreff: Re: list to template

On Tue, Feb 15, 2011 at 2:36 PM, Szabo, Patrick (LNG-VIE)
 wrote:
> According to youre link my synthax was correct:
>
>* Dictionary lookup. Example: foo["bar"]
>* Attribute lookup. Example: foo.bar
>* Method call. Example: foo.bar()
>* List-index lookup. Example: foo[bar]
>
> Anyway none of those work :-(
>

Is this in some way a joke? I'm not getting it.

>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
> Auftrag von Tom Evans
> http://docs.djangoproject.com/en/1.2/ref/templates/api/#rendering-a-context
>
> Templates use '.' as a special lookup when used in a variable name.
> You can use a dot to do dictionary lookup, attribute lookup, method
> calls and list index lookup. What you are trying to do is the latter.
>
> The correct way of doing it is:
>
> {{ buchung.0.0 }}
>

I refer you to my original response and the linked documentation.

Tom

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



Re: list to template

2011-02-15 Thread Tom Evans
On Tue, Feb 15, 2011 at 2:36 PM, Szabo, Patrick (LNG-VIE)
 wrote:
> According to youre link my synthax was correct:
>
>    * Dictionary lookup. Example: foo["bar"]
>    * Attribute lookup. Example: foo.bar
>    * Method call. Example: foo.bar()
>    * List-index lookup. Example: foo[bar]
>
> Anyway none of those work :-(
>

Is this in some way a joke? I'm not getting it.

>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
> Auftrag von Tom Evans
> http://docs.djangoproject.com/en/1.2/ref/templates/api/#rendering-a-context
>
> Templates use '.' as a special lookup when used in a variable name.
> You can use a dot to do dictionary lookup, attribute lookup, method
> calls and list index lookup. What you are trying to do is the latter.
>
> The correct way of doing it is:
>
> {{ buchung.0.0 }}
>

I refer you to my original response and the linked documentation.

Tom

-- 
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 Does Not Insert Record; Instead Updates Multiple Records With Date

2011-02-15 Thread octopusgrabbus
My problem is I create a model object and then save it. The data I put
in the model, which is not added. Instead an update of all similar
part numbers with the date occurs. I know about the override that
forces an insert. Is that what I should do?

Here is a sample of the data:
part_num,"ept_type","inv_id","load_date"
VWP-1602-201,43,80556338,"2011-02-15"   
I'm

Here is the web template:

 {% extends "base.html" %}

{% block content %}
Load Single Inventory Unit 

{% if errors %}
{% for error in errors %}
{{ error }}
{% endfor %}

{% endif %}

 {% csrf_token %}
Inventory Part Number:           


Inventory Type:              
         


Inventory Serial Number (ID): 



AMR Application Main Page
{% endblock content %}

Here is the view subroutine to handle the request from the web page
(partial listing):

from amr.inventory_add.models import EptInv

from funcs import *

from util_lib import *
from util_class_lib import *

def load_inv(request):
errors = []
if request.method == 'POST':
if not request.POST.get('part_num', ''):
errors.append('Please enter a valid inventory part
number.')
else:
if not request.POST.get('ept_type', ''):
errors.append('Please enter a valid inventory type.')
else:
requested_serial_number =
request.POST.get('inv_id', '')

try:
temp_ept_id =
EptInv.objects.get(inv_id=requested_serial_number)
errors.append('Endpoint is present in
inventory.')

except ObjectDoesNotExist:
# element was not found - it is OK to add to
database.
gd = createGlobalData(getMySQLDateTime())
load_date = gd.getMySQLDate()
inv_obj = \
 
EptInv(part_num=request.POST.get('part_num'), \
 
ept_type=request.POST.get('ept_type'), \
 
inv_id=request.POST.get('inv_id'), \
   load_date=load_date)
inv_obj.save()

  Here is the model:

from django.db import models

class EptInv(models.Model):
part_num = models.CharField(max_length=60, blank=True)
ept_type = models.IntegerField(primary_key=True)
inv_id = models.IntegerField(primary_key=True)
load_date = models.DateField(null=True, blank=True)
class Meta:
db_table = u'ept_inv'

def __unicode__(self):

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



AW: list to template

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
According to youre link my synthax was correct:

* Dictionary lookup. Example: foo["bar"]
* Attribute lookup. Example: foo.bar
* Method call. Example: foo.bar()
* List-index lookup. Example: foo[bar]

Anyway none of those work :-(


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Tom Evans
Gesendet: Dienstag, 15. Februar 2011 15:24
An: django-users@googlegroups.com
Betreff: Re: list to template

On Tue, Feb 15, 2011 at 2:09 PM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
> Now when i try to acces that lists with
>
> {{ buchung[0][0] }}
>

This isn't particularly well documented, best I could find is this:

http://docs.djangoproject.com/en/1.2/ref/templates/api/#rendering-a-context

Templates use '.' as a special lookup when used in a variable name.
You can use a dot to do dictionary lookup, attribute lookup, method
calls and list index lookup. What you are trying to do is the latter.

The correct way of doing it is:

{{ buchung.0.0 }}

Cheers

Tom

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



Re: Progress Bar/ProgressBarUploadHandler Documentation Examples

2011-02-15 Thread Derek
Fortunately, other clever coders have written up on this:
http://fairviewcomputing.com/blog/2008/10/21/ajax-upload-progress-bars-jquery-django-nginx/

On Feb 14, 4:56 pm, hank23  wrote:
> Are there any exampels of how to code Progress bars or the handlers
> which support them somewhere in the django documentation? they're
> referenced in the documentation, but without showing any actual coding
> examples.

-- 
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: Login, Password Recovery, etc

2011-02-15 Thread Derek
I am behind a firewall and have no problem downloading; maybe your
company has blocked access to github?

On Feb 14, 4:07 pm, Andre Terra  wrote:
> Is it just me or there aren't any downloads available for these projects?
> I'm behind a firewall and can't really try cloning from git.
>
> Thanks in advance for the help
>
> Sincerely,
> Andre Terra
>
> On Sun, Feb 13, 2011 at 7:40 PM, indymike  wrote:
> > Andres -
>
> > Thank you. This is EXACTLY what I was looking for. Five stars to you.
>
> > On Feb 13, 2:10 pm, Andres Lucena  wrote:
> > > El vie, 11-02-2011 a las 21:06 -0500, Mike Seidle escribió:
>
> > > > Quick question - is there an application or examples of completely
> > implemented
> > > > user authentication templates?  It's getting old trying to devine how
> > to set
> > > > up templates for password recovery and registration. Seems to me that
> > this
> > > > should (and probably is) included with the rest of the batteries.
>
> > > Sure, here:
>
> > >https://github.com/yourcelf/django-registration-defaults
>
> > > Also this one:
>
> > >https://github.com/banterability/django-registration-templates
>
> > > (don't remember what was the one I used, but the two seems to be fine)
>
> > > Hope this is what you're looking for.
>
> > > See you,
> > > Andres
>
> > --
> > 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.



Re: list to template

2011-02-15 Thread Tom Evans
On Tue, Feb 15, 2011 at 2:09 PM, Szabo, Patrick (LNG-VIE)
 wrote:
> Hi,
>
> Now when i try to acces that lists with
>
> {{ buchung[0][0] }}
>

This isn't particularly well documented, best I could find is this:

http://docs.djangoproject.com/en/1.2/ref/templates/api/#rendering-a-context

Templates use '.' as a special lookup when used in a variable name.
You can use a dot to do dictionary lookup, attribute lookup, method
calls and list index lookup. What you are trying to do is the latter.

The correct way of doing it is:

{{ buchung.0.0 }}

Cheers

Tom

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



list to template

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
 

Sry a part of my code was wrong i use

 

{%for buchung in result %}

{{ buchung[0][0] }}

{%endfor%}

 

To acces the list...

 

Von: Szabo, Patrick (LNG-VIE) 
Gesendet: Dienstag, 15. Februar 2011 15:09
An: 'django-users@googlegroups.com'
Betreff: list to template

 

Hi, 

 

What i want to do is show all DB-entries of a certain user.

These entries include foreign keys and i need to get the related objects
too and print them in a template

 

So what i do is this:

 

First i get all the objects that i need. 

 

buchungen = Buchung.objects.filter(Mitarbeiter = request.user.id)

 

then i want to make a list that stores lists where each of those lists
contains an object and the related objects: 

 

for buchung in buchungen:

books.append([buchung, buchung.Produkt, buchung.Aktivitaet])

 

and i pass it on to the template:

 

return render_to_response('main/index.html', {'user' : request.user,
'form' : f, 'result' : books}, context_instance=RequestContext(request))

 

Now when i try to acces that lists with

 

{{ buchung[0][0] }}

 

I get the following error:

 

Could not parse the remainder: '[0][0]' from 'buchung[0][0]'

 

How can i get acces tot hat lists ?!

 

Kind regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 





-- 
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 + Legacy MSSQL LATIN1

2011-02-15 Thread Manuel Gonçalves - Analista de Sistemas
 Hi guys, I new on the group, it,s my first post:

Question 1:  I have success to play django + pyodbc on debian linux to
connect on MSSQL legacy database, I try django-mssql but it,s look
likes play only on windows machines, Does anyone have anothes MSSQL
backend to integrate  django + MSSQL on debian server ?

Question 2: My legacy database has  latin1 collation, django throw
error on access it, I can,t change it  to utf-8. Is there a way to
resolve decode errors when acess data?

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



list to template

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
Hi, 

 

What i want to do is show all DB-entries of a certain user.

These entries include foreign keys and i need to get the related objects
too and print them in a template

 

So what i do is this:

 

First i get all the objects that i need. 

 

buchungen = Buchung.objects.filter(Mitarbeiter = request.user.id)

 

then i want to make a list that stores lists where each of those lists
contains an object and the related objects: 

 

for buchung in buchungen:

books.append([buchung, buchung.Produkt, buchung.Aktivitaet])

 

and i pass it on to the template:

 

return render_to_response('main/index.html', {'user' : request.user,
'form' : f, 'result' : books}, context_instance=RequestContext(request))

 

Now when i try to acces that lists with

 

{{ buchung[0][0] }}

 

I get the following error:

 

Could not parse the remainder: '[0][0]' from 'buchung[0][0]'

 

How can i get acces tot hat lists ?!

 

Kind regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 





-- 
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: Google App Engine supports Django 1.2!

2011-02-15 Thread strap
Hi,
you can start here:
http://code.google.com/appengine/articles/django-nonrel.html
http://code.google.com/appengine/articles/appengine_helper_for_django.html
http://www.allbuttonspressed.com/blog/django

hth,
Cheers
Strap

On Feb 14, 7:15 pm, Gath  wrote:
> Please give me a pointer/link to a tutorial on how i can use GAE with
> django.
>
> Thanks,
> Gath.
>
> On Feb 14, 7:12 am, Sarang  wrote:
>
>
>
>
>
>
>
> > Thanks for the clarification. Yes, I am using django-nonrel which installed
> > 1.3.0 alpha 1 for me.
>
> > Regards,
> > Sarang

-- 
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 + WebDAV

2011-02-15 Thread Thomas Weholt
Please post any findings on this subject or information about any
projects you might start to solve/provide this to this group. This is
very interesting. :-)
I`ve made a ftpserver which authenticates logins using django user
management, but a webdavserver would be even nicer.

Thomas

On Tue, Feb 15, 2011 at 5:50 AM, Michael A. Ryan  wrote:
> Hello Django Users
>
> I'm looking for people who have experience interfacing Django with WebDAV 
> protocol, or using Django as a basis for authentication to a WebDAV server.
>
> I'm interested in at least comparing notes but potentially interested in 
> maybe co-authoring an open source module for WebDAV.
>
> Thanks,
>
> Michael
>
> --
> 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.
>
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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.



chrome extension

2011-02-15 Thread Tony
Hi,
Is there any way to have a chrome extension with a backend in Django,
like for storing data server side and using its views?  Or is this not
possible?
thanks

-- 
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 + WebDAV

2011-02-15 Thread Michael A. Ryan
Hello Django Users

I'm looking for people who have experience interfacing Django with WebDAV 
protocol, or using Django as a basis for authentication to a WebDAV server.

I'm interested in at least comparing notes but potentially interested in maybe 
co-authoring an open source module for WebDAV.

Thanks,

Michael

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



AW: AW: images

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
Now it works...Thanks a lot everybody !

. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 





-- 
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: AW: images

2011-02-15 Thread Kenneth Gonsalves
On Tue, 2011-02-15 at 11:07 +0100, Szabo, Patrick (LNG-VIE) wrote:
> How do i check the logs !?
> I'm using the integrated webserver. 

you are running it from the console - it will give error messages like
404 with a path
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



Re: AW: AW: Form to add data

2011-02-15 Thread Daniel Roseman

On Monday, February 14, 2011 1:59:08 PM UTC, Szabo, Patrick (LNG-VIE) wrote:
>
>  
>
Now i did exclude certain fields in my form because i have to set them 
> automaticaly.
> Eg. I have a field that's called Mitarbeiter. I want to set the field to 
> the current user id so i've tried this:
>
> def main(request):
> f = BuchungForm(request.POST)
> buchung = f.save(commit=False)
> buchung.Mitarbeiter = 'request.user.id'
> buchung.save()
> return render_to_response('main/index.html', {'user' : request.user, 
> 'form' : f})
>
> but this gives me the following error:
>
> could not be created because the data didn't validate.
>
> It seems like as soon as i enter the site it tries co submit the data. Can 
> i somehow stop that from hapening. ?!
>
Yes, by following the documentation that Tom has now linked to twice.  For 
absolute clarity, let me link you to the actual bit again:
http://docs.djangoproject.com/en/1.2/topics/forms/#using-a-form-in-a-view
This shows you exactly how to do it. Please follow it.
--
DR.

-- 
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: images

2011-02-15 Thread Piotr Zalewa

Learn how to serve static files
For the Django 1.3+
http://docs.djangoproject.com/en/dev/howto/static-files/
For Django 1.2
http://docs.djangoproject.com/en/1.2/howto/static-files/

Good luck
zalun
On 02/15/11 10:00, Szabo, Patrick (LNG-VIE) wrote:
> Hi, 
> 
> I just want an image to be shown in my header so i just added it in my
> template like this:
> 
> 
> 
> Unfortunately i only get the "alt text" shown and not the image. 
> The image is in the same directory as the template.
> 
> Why doesn't this work ?!
> 
> Kind regards
> 
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT-Entwickler 
> LexisNexis
> Marxergasse 25, 1030 Wien
> 
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573 
> Fax: +43 (1) 534 52 - 146 
> 
> 
> 
> 
> 


-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
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: images

2011-02-15 Thread Ian McDowall


On Feb 15, 10:16 am, Praveen Krishna R 
wrote:
> *plz Check django official docs to find out how static files are served on
> production and development server.*
> *
> *
> *in the dev server include a similiar snippet into your projects
> urls.py, urlpatterns:*
> *
> *
> *(r'^site_media/(?P.*)$',
> 'django.views.static.serve',{'document_root':
> 'D:/djangoprojects/praveensprofile/templates/static'}),*
> *
> *
> ***and in the templates something similar to the below text.*
> *
> *
> *
> *
> *
> *
> On Tue, Feb 15, 2011 at 1:07 PM, Szabo, Patrick (LNG-VIE) <
>
>
>
> patrick.sz...@lexisnexis.at> wrote:
> > How do i check the logs !?
> > I'm using the integrated webserver.
>
> > Kind regards
>
> > . . . . . . . . . . . . . . . . . . . . . . . . . .
> > Patrick Szabo
> >  XSLT-Entwickler
> > LexisNexis
> > Marxergasse 25, 1030 Wien
>
> > mailto:patrick.sz...@lexisnexis.at
> > Tel.: +43 (1) 534 52 - 1573
> > Fax: +43 (1) 534 52 - 146
>
> > -Ursprüngliche Nachricht-
>
> > Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> > Im Auftrag von Kenneth Gonsalves
> > Gesendet: Dienstag, 15. Februar 2011 11:05
> > An: django-users@googlegroups.com
> > Betreff: Re: images
>
> > On Tue, 2011-02-15 at 11:00 +0100, Szabo, Patrick (LNG-VIE) wrote:
> > > Unfortunately i only get the "alt text" shown and not the image.
> > > The image is in the same directory as the template.
>
> > check your logs to see where it is searching for your image
> > --
> > regards
> > KG
> >http://lawgon.livejournal.com
> > Coimbatore LUG rox
> >http://ilugcbe.techstud.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.
>
> > --
> > 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.
>
> --
> Thanks and Regards,
> *Praveen Krishna R*

Just to slightly expand on what Praveen said. Static files are served
differently from templates.

Templates are loaded from views using a configured template path.

Static files are served by your web server according to its
configuration. If you are using the development web server then you
need to configure Django as Praveen suggests to set the media path.
if you are serving any other static content then you have already done
this. As and when you move to a production web server, you will need
to configure that appropriately. You should be able to leave the links
unchanged (unless you do something daft) and just configure the web
server correctly.

Cheers, Ian

-- 
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: images

2011-02-15 Thread Praveen Krishna R
*plz Check django official docs to find out how static files are served on
production and development server.*
*
*
*in the dev server include a similiar snippet into your projects
urls.py, urlpatterns:*
*
*
*(r'^site_media/(?P.*)$',
'django.views.static.serve',{'document_root':
'D:/djangoprojects/praveensprofile/templates/static'}),*
*
*
***and in the templates something similar to the below text.*
*
*
*
*
*
*
On Tue, Feb 15, 2011 at 1:07 PM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

> How do i check the logs !?
> I'm using the integrated webserver.
>
> Kind regards
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
>  XSLT-Entwickler
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> mailto:patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146
>
>
> -Ursprüngliche Nachricht-
>
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> Im Auftrag von Kenneth Gonsalves
> Gesendet: Dienstag, 15. Februar 2011 11:05
> An: django-users@googlegroups.com
> Betreff: Re: images
>
> On Tue, 2011-02-15 at 11:00 +0100, Szabo, Patrick (LNG-VIE) wrote:
> > Unfortunately i only get the "alt text" shown and not the image.
> > The image is in the same directory as the template.
>
> check your logs to see where it is searching for your image
> --
> regards
> KG
> http://lawgon.livejournal.com
> Coimbatore LUG rox
> http://ilugcbe.techstud.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.
>
>
>
> --
> 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.
>
>


-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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 Mutlisite Setup

2011-02-15 Thread Cal Leeming [Simplicity Media Ltd]
Might also want to try django multihost :)

On Tue, Feb 15, 2011 at 9:58 AM, Aryeh Leib Taurog wrote:

> On Feb 14, 5:08 am, Jason Drane  wrote:
> > Forgive me if this question  offends you more advanced users. I am
> > begun down the road of learning Django. I am curious if it is possible
> > to place Django in the root of my server and reference it to each of
> > multiple sites in development, similar to php, python, etc.
>
> This kind of question comes up now and then.  I believe this setup
> isn't recommended.  However, it's not difficult to do, either.  I
> think it makes a lot of sense for someone with several small low-
> traffic sites, especially where server resources are limited (say on a
> shared host account).  You could accomplish this by configuring the
> web server to map each domain to a different base path in the url.
> For example, using lighttpd/fastcgi you would have something like
> this:
>
> #--- lighttpd.conf --
> fastcgi.server = (
>   "/django.fcgi" => (
>"main" => ( "socket" => "/var/www/django.sock", "check-local"
> => "disable", )
>   )
> )
>
> $HTTP["host"] == "site1.example.com" {
>alias.url = ( "/static" => "/var/www/site1/static" )
>url.rewrite-once = (
>"^(/static/.*)$" => "$1",
>"^(/.*)$" => "/django.fcgi/site1$1",
>)
> }
>
> $HTTP["host"] == "secondsite.example.com" {
>alias.url = ( "/static" => "/var/www/secondsite/static" )
>url.rewrite-once = (
>"^(/static/.*)$" => "$1",
>"^(/.*)$" => "/django.fcgi/secondsite$1",
>)
> }
> #-
>
> Then you set up your django urls like this
>
> #--- urls.py
> from django.conf.urls.defaults import *
>
> urlpatterns = patterns('',
>   url(r'^site1/', include('site1.urls')),
>   url(r'^secondsite/',
> include('secondsite.urls')),
> )
> #-
>
> --
> 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.



AW: images

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
How do i check the logs !?
I'm using the integrated webserver.

Kind regards


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 


-Ursprüngliche Nachricht-

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Kenneth Gonsalves
Gesendet: Dienstag, 15. Februar 2011 11:05
An: django-users@googlegroups.com
Betreff: Re: images

On Tue, 2011-02-15 at 11:00 +0100, Szabo, Patrick (LNG-VIE) wrote:
> Unfortunately i only get the "alt text" shown and not the image. 
> The image is in the same directory as the template. 

check your logs to see where it is searching for your image
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



-- 
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: images

2011-02-15 Thread Kenneth Gonsalves
On Tue, 2011-02-15 at 11:00 +0100, Szabo, Patrick (LNG-VIE) wrote:
> Unfortunately i only get the "alt text" shown and not the image. 
> The image is in the same directory as the template. 

check your logs to see where it is searching for your image
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.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.



images

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
Hi, 

I just want an image to be shown in my header so i just added it in my
template like this:



Unfortunately i only get the "alt text" shown and not the image. 
The image is in the same directory as the template.

Why doesn't this work ?!

Kind regards

. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 





-- 
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: Saving multiple records from admin list page

2011-02-15 Thread Chris Matthews
Hi Sithembewena,

If you want to monitor changes to tables then you might also be interested in 
keeping audit/history records. See the book ProJango by Marty Alchin Chapter 11 
(page 263 onwards) and http://qr7.com/2010/10/django-simple-history-ftw/  by 
Corey Bertram

Regards
Chris

From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of Sithembewena Lloyd Dube
Sent: 15 February 2011 11:17
To: django-users@googlegroups.com
Subject: Saving multiple records from admin list page

Hi all,

In my admin.py, I overrode the save() function of a model as follows:

from myproject.myapp.functions import 
send_staking_request_status_notification_email

def save_model(self, request, obj, form, change):
  staking_request = obj
  obj.save()
  send_staking_request_status_notification_email(staking_request)

Therefore, when an admin user logs in and saves a record, an email is sent off 
to a site member. The function that does the emailing is imported from a custom 
module and this works fine.

However, on the list page of said model in the admin area, the admin user is 
also able to select an action to apply to multiple records. How can I modify my 
admin.py so that the save() override specified above
fires for all records?

Thanks.
--
Regards,
Sithembewena Lloyd Dube
--
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.



Re: Django Mutlisite Setup

2011-02-15 Thread Aryeh Leib Taurog
On Feb 14, 5:08 am, Jason Drane  wrote:
> Forgive me if this question  offends you more advanced users. I am
> begun down the road of learning Django. I am curious if it is possible
> to place Django in the root of my server and reference it to each of
> multiple sites in development, similar to php, python, etc.

This kind of question comes up now and then.  I believe this setup
isn't recommended.  However, it's not difficult to do, either.  I
think it makes a lot of sense for someone with several small low-
traffic sites, especially where server resources are limited (say on a
shared host account).  You could accomplish this by configuring the
web server to map each domain to a different base path in the url.
For example, using lighttpd/fastcgi you would have something like
this:

#--- lighttpd.conf --
fastcgi.server = (
   "/django.fcgi" => (
"main" => ( "socket" => "/var/www/django.sock", "check-local"
=> "disable", )
   )
)

$HTTP["host"] == "site1.example.com" {
alias.url = ( "/static" => "/var/www/site1/static" )
url.rewrite-once = (
"^(/static/.*)$" => "$1",
"^(/.*)$" => "/django.fcgi/site1$1",
)
}

$HTTP["host"] == "secondsite.example.com" {
alias.url = ( "/static" => "/var/www/secondsite/static" )
url.rewrite-once = (
"^(/static/.*)$" => "$1",
"^(/.*)$" => "/django.fcgi/secondsite$1",
)
}
#-

Then you set up your django urls like this

#--- urls.py
from django.conf.urls.defaults import *

urlpatterns = patterns('',
   url(r'^site1/', include('site1.urls')),
   url(r'^secondsite/',
include('secondsite.urls')),
)
#-

-- 
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: Saving multiple records from admin list page

2011-02-15 Thread Sithembewena Lloyd Dube
Courtesy of Django docs, by the way:

http://docs.djangoproject.com/en/1.2/ref/contrib/admin/actions/

On Tue, Feb 15, 2011 at 11:47 AM, Sithembewena Lloyd Dube  wrote:

> Solution found: I simply added a function call to the mailing function in
> each action definition in admin.py as follows:
>
>  actions = ['staking_approved', 'staking_in_process',
> 'staking_rejected', 'staking_review_later']
>
>
>  def save_model(self, request, obj, form, change):
>   staking_request = obj
>   obj.save()
>   send_staking_request_status_notification_email(staking_request)
>
>  def staking_approved(modeladmin, request, queryset):
>   queryset.update(reviewed=1)
>   for obj in queryset:
>send_staking_request_status_notification_email(obj)
>
>  def staking_in_process(modeladmin, request, queryset):
>   queryset.update(reviewed=2)
>   for obj in queryset:
>send_staking_request_status_notification_email(obj)
>
>  def staking_rejected(modeladmin, request, queryset):
>   queryset.update(reviewed=3)
>   for obj in queryset:
>send_staking_request_status_notification_email(obj)
>
>  def staking_review_later(modeladmin, request, queryset):
>   queryset.update(reviewed=4)
>   for obj in queryset:
>send_staking_request_status_notification_email(obj)
>
> Thanks.
>
>
> On Tue, Feb 15, 2011 at 11:16 AM, Sithembewena Lloyd Dube <
> zebr...@gmail.com> wrote:
>
>> Hi all,
>>
>> In my admin.py, I overrode the save() function of a model as follows:
>>
>> from myproject.myapp.functions import
>> send_staking_request_status_notification_email
>>
>> def save_model(self, request, obj, form, change):
>>   staking_request = obj
>>   obj.save()
>>   send_staking_request_status_notification_email(staking_request)
>>
>> Therefore, when an admin user logs in and saves a record, an email is sent
>> off to a site member. The function that does the emailing is imported from a
>> custom module and this works fine.
>>
>> However, on the list page of said model in the admin area, the admin user
>> is also able to select an action to apply to multiple records. How can I
>> modify my admin.py so that the save() override specified above
>> fires for all records?
>>
>> Thanks.
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
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: Saving multiple records from admin list page

2011-02-15 Thread Sithembewena Lloyd Dube
Solution found: I simply added a function call to the mailing function in
each action definition in admin.py as follows:

 actions = ['staking_approved', 'staking_in_process',
'staking_rejected', 'staking_review_later']

 def save_model(self, request, obj, form, change):
  staking_request = obj
  obj.save()
  send_staking_request_status_notification_email(staking_request)

 def staking_approved(modeladmin, request, queryset):
  queryset.update(reviewed=1)
  for obj in queryset:
   send_staking_request_status_notification_email(obj)

 def staking_in_process(modeladmin, request, queryset):
  queryset.update(reviewed=2)
  for obj in queryset:
   send_staking_request_status_notification_email(obj)

 def staking_rejected(modeladmin, request, queryset):
  queryset.update(reviewed=3)
  for obj in queryset:
   send_staking_request_status_notification_email(obj)

 def staking_review_later(modeladmin, request, queryset):
  queryset.update(reviewed=4)
  for obj in queryset:
   send_staking_request_status_notification_email(obj)

Thanks.

On Tue, Feb 15, 2011 at 11:16 AM, Sithembewena Lloyd Dube  wrote:

> Hi all,
>
> In my admin.py, I overrode the save() function of a model as follows:
>
> from myproject.myapp.functions import
> send_staking_request_status_notification_email
>
> def save_model(self, request, obj, form, change):
>   staking_request = obj
>   obj.save()
>   send_staking_request_status_notification_email(staking_request)
>
> Therefore, when an admin user logs in and saves a record, an email is sent
> off to a site member. The function that does the emailing is imported from a
> custom module and this works fine.
>
> However, on the list page of said model in the admin area, the admin user
> is also able to select an action to apply to multiple records. How can I
> modify my admin.py so that the save() override specified above
> fires for all records?
>
> Thanks.
> --
> Regards,
> Sithembewena Lloyd Dube
>



-- 
Regards,
Sithembewena Lloyd Dube

-- 
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: AW: AW: Form to add data

2011-02-15 Thread Benedict Verheyen


> def main(request):
> f = BuchungForm(request.POST)
> buchung = f.save(commit=False)
> buchung.Mitarbeiter = 'request.user.id'
> buchung.save()
> return render_to_response('main/index.html', {'user' : request.user, 
> 'form' : f})
> 
> but this gives me the following error:
> 
> could not be created because the data didn't validate.
> 
> It seems like as soon as i enter the site it tries co submit the data. Can i 
> somehow stop that from hapening. ?!
> 
> Tom


Hi,


try changing this
buchung.Mitarbeiter = 'request.user.id'

into this:
buchung.Mitarbeiter = request.user

This implies that Mitarbeiter is specified as of the type User in your model:

...
from django.contrib.auth.models import User

class Buchung(models.Model):
...
Mitarbeiter = models.ForeignKey(User)


Regards,
Benedict

-- 
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 Templates: Form field name as variable?

2011-02-15 Thread ju
Thank you very much for you answer

I prefer to use validation that form class provides for me...

I tried to use  but
the other problem that I have is that I can't get errors for each
field of form :(

There is another solution that I decide to use:
http://stackoverflow.com/questions/4993625/django-templates-form-field-name-as-variable

-- 
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 API efficient enough for filtering tens of millions of records?

2011-02-15 Thread Thomas Weholt
FYI: release version 0.5.0 of DSE yesterday. Source is available at
https://bitbucket.org/weholt/dse and pypi.

Regards,
Thomas Weholt

On Tue, Feb 15, 2011 at 10:10 AM, Sithembewena Lloyd Dube
 wrote:
> Hi Everyone,
>
> Coming back weeks later, to say thank you for your contributions. I got
> quite sidetracked from this task, but I should report back on this soon.
>
> Thank you!
>
> On Wed, Jan 19, 2011 at 10:05 AM, Thomas Weholt 
> wrote:
>>
>> Bulk inserts are the way the go if you can. When inserting a bunch of
>> data, avoid using the django orm. Do it in plain SQL. The overhead of
>> creating django orm model instances is way too expensive. Alltough it
>> may not be bulk insert the sense Nick mentioned above I wrote DSE [
>> http://pypi.python.org/pypi/dse/0.3.1 ] for that exact purpose, to
>> insert or update a bunch of data using plain SQL, but it hasn`t been
>> tested much so don`t use it in production. The thing it solves, can be
>> done in simple SQL;
>>
>> Use cursor.executemany("", > with params>).
>>
>> DSE takes care of creating SQL-statements for insert and updates based
>> on your models, handles any default values you might have defined in
>> your model, caches lists of params and executes cursor.executemany
>> when the list of cached items reaches a specified limit. My experience
>> is that the performance gain of this solution or a similar one is
>> huge. Using cursor.executemany might be what Nick meant by bulk
>> insert, but I think different DB backends handles it differently. I
>> don`t know. Anyway, I've inserted many thousands of records using DSE
>> and it takes a fraction of the time when compared to doing it with the
>> orm.
>>
>>
>> NB! DSE is a proof-of-concept project more than anything else. It
>> needs a good re-write, extensive testing and docs, but it might be
>> helpful.
>>
>> Thomas
>>
>>
>>
>>
>>
>> On Wed, Jan 19, 2011 at 2:35 AM, Nick Arnett 
>> wrote:
>> >
>> >
>> > On Tue, Jan 18, 2011 at 12:04 PM, Sithembewena Lloyd Dube
>> >  wrote:
>> >>
>> >> Hi all,
>> >>
>> >> I am building a search app. that will query an API. The app. will also
>> >> store search terms in a very simple table structure.
>> >>
>> >> Big question: if the app. eventually hit 10 million searches and I was
>> >> storing every single search term, would the table hold or would I run
>> >> into
>> >> issues?
>> >
>> > As someone else said, 10 million records is no big deal for MySQL, in
>> > principle.
>> > However, you probably would do better to avoid all the overhead of a
>> > database transaction for storing each of these.  I'm going to assume
>> > that
>> > there will be duplicates, especially if you normalize the queries.  It
>> > would
>> > make a lot more sense to log the queries into a text file, which has
>> > extremely low overhead.  Then you'd periodically process the log files,
>> > normalizing and eliminating duplicates, producing a bulk insert to load
>> > into
>> > the database.  Bulk inserts will be FAR more efficient than using
>> > Django.
>> > Nick
>> >
>> > --
>> > 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.
>> >
>>
>>
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.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.
>>
>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
>
> --
> 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.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.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.



Saving multiple records from admin list page

2011-02-15 Thread Sithembewena Lloyd Dube
Hi all,

In my admin.py, I overrode the save() function of a model as follows:

from myproject.myapp.functions import
send_staking_request_status_notification_email

def save_model(self, request, obj, form, change):
  staking_request = obj
  obj.save()
  send_staking_request_status_notification_email(staking_request)

Therefore, when an admin user logs in and saves a record, an email is sent
off to a site member. The function that does the emailing is imported from a
custom module and this works fine.

However, on the list page of said model in the admin area, the admin user is
also able to select an action to apply to multiple records. How can I modify
my admin.py so that the save() override specified above
fires for all records?

Thanks.
-- 
Regards,
Sithembewena Lloyd Dube

-- 
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 API efficient enough for filtering tens of millions of records?

2011-02-15 Thread Sithembewena Lloyd Dube
Hi Everyone,

Coming back weeks later, to say thank you for your contributions. I got
quite sidetracked from this task, but I should report back on this soon.

Thank you!

On Wed, Jan 19, 2011 at 10:05 AM, Thomas Weholt wrote:

> Bulk inserts are the way the go if you can. When inserting a bunch of
> data, avoid using the django orm. Do it in plain SQL. The overhead of
> creating django orm model instances is way too expensive. Alltough it
> may not be bulk insert the sense Nick mentioned above I wrote DSE [
> http://pypi.python.org/pypi/dse/0.3.1 ] for that exact purpose, to
> insert or update a bunch of data using plain SQL, but it hasn`t been
> tested much so don`t use it in production. The thing it solves, can be
> done in simple SQL;
>
> Use cursor.executemany("",  with params>).
>
> DSE takes care of creating SQL-statements for insert and updates based
> on your models, handles any default values you might have defined in
> your model, caches lists of params and executes cursor.executemany
> when the list of cached items reaches a specified limit. My experience
> is that the performance gain of this solution or a similar one is
> huge. Using cursor.executemany might be what Nick meant by bulk
> insert, but I think different DB backends handles it differently. I
> don`t know. Anyway, I've inserted many thousands of records using DSE
> and it takes a fraction of the time when compared to doing it with the
> orm.
>
>
> NB! DSE is a proof-of-concept project more than anything else. It
> needs a good re-write, extensive testing and docs, but it might be
> helpful.
>
> Thomas
>
>
>
>
>
> On Wed, Jan 19, 2011 at 2:35 AM, Nick Arnett 
> wrote:
> >
> >
> > On Tue, Jan 18, 2011 at 12:04 PM, Sithembewena Lloyd Dube
> >  wrote:
> >>
> >> Hi all,
> >>
> >> I am building a search app. that will query an API. The app. will also
> >> store search terms in a very simple table structure.
> >>
> >> Big question: if the app. eventually hit 10 million searches and I was
> >> storing every single search term, would the table hold or would I run
> into
> >> issues?
> >
> > As someone else said, 10 million records is no big deal for MySQL, in
> > principle.
> > However, you probably would do better to avoid all the overhead of a
> > database transaction for storing each of these.  I'm going to assume that
> > there will be duplicates, especially if you normalize the queries.  It
> would
> > make a lot more sense to log the queries into a text file, which has
> > extremely low overhead.  Then you'd periodically process the log files,
> > normalizing and eliminating duplicates, producing a bulk insert to load
> into
> > the database.  Bulk inserts will be FAR more efficient than using Django.
> > Nick
> >
> > --
> > 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.
> >
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.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.
>
>


-- 
Regards,
Sithembewena Lloyd Dube

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



AW: Having trouble synchronizing the database, can someone help?

2011-02-15 Thread Szabo, Patrick (LNG-VIE)
I think i rember reading in the doc that you can somehow run custom sql...is 
that an option ?!

 

If this is something you don’t have to do regularly you could also just connect 
to the db with some gui-client and delete the tables there

 

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Chen Xu
Gesendet: Dienstag, 15. Februar 2011 09:01
An: django-users@googlegroups.com
Betreff: Re: Having trouble synchronizing the database, can someone help?

 

thanks, flush does help, but it delete everything, however I have 2 apps in my 
db, so is there any commands (ex: sqlclear ) that allows me to only 
remove the tables in particular app??

Thanks

On Mon, Feb 14, 2011 at 11:51 PM, Szabo, Patrick (LNG-VIE) 
 wrote:

I think sqlflush just prints the SQL-Statement.

Flush will actually du the job

 

Hope that helps !

 

. . . . . . . . . . . . . . . . . . . . . . . . . .

Patrick Szabo
XSLT-Entwickler 

LexisNexis
Marxergasse 25, 1030 Wien

patrick.sz...@lexisnexis.at

Tel.: +43 (1) 534 52 - 1573 

Fax: +43 (1) 534 52 - 146 

 

Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
Auftrag von Chen Xu
Gesendet: Dienstag, 15. Februar 2011 08:45
An: django-users@googlegroups.com
Betreff: Re: Having trouble synchronizing the database, can someone help?

 

thanks very much everyone, but I just have one more small question.

I tried to use some python manage.py command to delete tables (ex: sqlflush, 
sqlreset),
but they all just print out the sql statement without doing the real job, so 
what is the command to do the actual removal of the tables?


Thanks

 

 

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




-- 
⚡ Chen Xu ⚡

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


. . . . . . . . . . . . . . . . . . . . . . . . . .
Patrick Szabo
 XSLT-Entwickler 
LexisNexis
Marxergasse 25, 1030 Wien

mailto:patrick.sz...@lexisnexis.at
Tel.: +43 (1) 534 52 - 1573 
Fax: +43 (1) 534 52 - 146 





-- 
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: Having trouble synchronizing the database, can someone help?

2011-02-15 Thread Xavier Ordoquy
flush will only flush the data from the base. It doesn't modify the table 
structure as far as I remember.
You can have a look at the thread "Model Codng/Model Usage Pitfall?" which was 
on the same topic yesteday.

Regards,
Xavier.

Le 15 févr. 2011 à 09:01, Chen Xu a écrit :

> thanks, flush does help, but it delete everything, however I have 2 apps in 
> my db, so is there any commands (ex: sqlclear ) that allows me to 
> only remove the tables in particular app??
> 
> Thanks
> 
> On Mon, Feb 14, 2011 at 11:51 PM, Szabo, Patrick (LNG-VIE) 
>  wrote:
> I think sqlflush just prints the SQL-Statement.
> 
> Flush will actually du the job
> 
>  
> Hope that helps !
> 
>  
> 
> . . . . . . . . . . . . . . . . . . . . . . . . . .
> Patrick Szabo
> XSLT-Entwickler
> LexisNexis
> Marxergasse 25, 1030 Wien
> 
> patrick.sz...@lexisnexis.at
> Tel.: +43 (1) 534 52 - 1573
> Fax: +43 (1) 534 52 - 146
> 
> Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] Im 
> Auftrag von Chen Xu
> Gesendet: Dienstag, 15. Februar 2011 08:45
> An: django-users@googlegroups.com
> Betreff: Re: Having trouble synchronizing the database, can someone help?
> 
>  
> thanks very much everyone, but I just have one more small question.
> 
> I tried to use some python manage.py command to delete tables (ex: sqlflush, 
> sqlreset),
> but they all just print out the sql statement without doing the real job, so 
> what is the command to do the actual removal of the tables?
> 
> 
> Thanks
> 
>  
> 
> 
> -- 
> 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.
> 
> 
> 
> -- 
> ⚡ Chen Xu ⚡
> 
> -- 
> 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.



Re: Having trouble synchronizing the database, can someone help?

2011-02-15 Thread Chen Xu
thanks, flush does help, but it delete everything, however I have 2 apps in
my db, so is there any commands (ex: sqlclear ) that allows me to
only remove the tables in particular app??

Thanks

On Mon, Feb 14, 2011 at 11:51 PM, Szabo, Patrick (LNG-VIE) <
patrick.sz...@lexisnexis.at> wrote:

>  I think sqlflush just prints the SQL-Statement.
>
> Flush will actually du the job
>
>
>
> Hope that helps !
>
>
>
> . . . . . . . . . . . . . . . . . . . . . . . . . .
>
>  **
>
> Patrick Szabo
> XSLT-Entwickler
>
> LexisNexis
> Marxergasse 25, 1030 Wien
>
> patrick.sz...@lexisnexis.at
>
> Tel.: +43 (1) 534 52 - 1573
>
> Fax: +43 (1) 534 52 - 146
>
>
> *Von:* django-users@googlegroups.com [mailto:django-users@googlegroups.com]
> *Im Auftrag von *Chen Xu
> *Gesendet:* Dienstag, 15. Februar 2011 08:45
> *An:* django-users@googlegroups.com
> *Betreff:* Re: Having trouble synchronizing the database, can someone
> help?
>
>
>
> thanks very much everyone, but I just have one more small question.
>
> I tried to use some python manage.py command to delete tables (ex:
> sqlflush, sqlreset),
> but they all just print out the sql statement without doing the real job,
> so what is the command to do the actual removal of the tables?
>
>
> Thanks
>
>
>
>
>  --
> 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.
>



-- 
⚡ Chen Xu ⚡

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