imagefiled don't Work

2012-01-20 Thread cha
Hello I reading this tutorial 
https://pype.its.utexas.edu/docs/tutorial/unit6.html#answers
it's work OK But When I want improve it and add ImageField in Category
Model i have problem with ImageField It's Not uploaded

file = models.ImageField(upload_to='img/%Y')


see code please :
_
views.py
_
from django import forms
class CategoryForm(forms.ModelForm):
class Meta:
model = Category

def add_category(request):
if request.method == "POST":
form = CategoryForm(request.POST, request.FILES)
## Handle AJAX  ##
if request.is_ajax():
if form.is_valid():
form.save()
# Get a list of Categories to return
cats = Category.objects.all().order_by('name')
# Create a dictionary for our response data
data = {
'error': False,
'message': 'Category %s Added Successfully' %
form.cleaned_data['name'],
# Pass a list of the 'name' attribute from each
Category.
# Django model instances are not serializable
'categories': [c.name for c in cats],
}
else:
# Form was not valid, get the errors from the form and
# create a dictionary for our error response.
data = {
'error': True,
'message': "Please try again! one",
'name_error': str(form.errors.get('name', '')),
'slug_error': str(form.errors.get('slug', '')),
'file_error': str(form.errors.get('file', '')),
}
# encode the data as a json object and return it
return http.HttpResponse(json.dumps(data))

## Old Form Handler Logic ##
if form.is_valid():
form.save()
return http.HttpResponseRedirect('/category/')
else:
form = CategoryForm()
cats = Category.objects.all().order_by('name')
context = Context({'title': 'Add Category', 'form': form,
'categories': cats})
return render_to_response('ajax_form.html',
context,context_instance=RequestContext(request))

___
ajax_form.html
___

 http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml";>

   {{ title }}
   
  #message {width:250px; background-color:#aaa;}
  .hide {display: none;}
   
   http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.js">




// prepare the form when the DOM is ready
$(document).ready(function() {
$("#add_cat").ajaxStart(function() {
// Remove any errors/messages and fade the form.
$(".form_row").removeClass('errors');
$(".form_row_errors").html('');
$("#add_cat").fadeTo('slow', 0.33);
$("#add_cat_btn").attr('disabled', 'disabled');
$("#message").addClass('hide');
});

// Submit the form with ajax.
$("#add_cat").submit(function(){
$.post(
// Grab the action url from the form.
"#add_cat.getAttribute('action')",

// Serialize the form data to send.
$("#add_cat").serialize(),

// Callback function to handle the response from view.
function(resp, testStatus) {
if (resp.error) {
// check for field errors
if (resp.name_error != '') {
$("#name_row").addClass('errors');
$("#name_errors").html(resp.name_error);
}
if (resp.slug_error != '') {
$("#slug_row").addClass('errors');
$("#slug_errors").html(resp.slug_error);
}
if (resp.file_error != '') {
$("#file_row").addClass('errors');
$("#file_errors").html(resp.file_error);
}
} else {
// No errors. Rewrite the category list.
$("#categories").fadeTo('fast', 0);
var text = new String();
for(i=0; i"
}
$("#categories").html(text);
$("#categories").fadeTo('slow', 1);
$("#id_name").attr('value', '');
$("#id_slug").attr('value', '');
$("#id_file").attr('value', '');
}
// Always show the message and re-enable the form.
$("#message").html(resp.message);
$("#message").removeClass('h

Re: How to use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
Thank you, Dennis.  I'll study your answer.  I have to do this kind of
thing for a lot of different tables.  And I discovered another thing:  In
the template I was reading the table in again from the database!  Before my
problem was solved, I could populate the selection list from the DB table,
but then there were no valid choices when I got back to the view.

I'm getting to know Django just enough that I can sometimes answer
questions posted here, or at least make suggestions.

Regards

On Fri, Jan 20, 2012 at 11:22 PM, Dennis Lee Bieber
wrote:

> On Fri, 20 Jan 2012 19:44:16 -0800 (PST), Bill Beal
>  wrote:
>
>Caveat: I've only looked at Django, but not in enough detail to be
> "expert"; my comments are based upon basic Python syntax/semantics (my
> apologies to the developers, but I work better with printed
> documentation and Django is too much of a moving target for the few
> books that did come out to be relevant four months later)
>
> >name 'scac_choicelist' is not defined at the marked
> >line in my form:
> >
> Which is true -- it is not defined at that point. (NOTE: your names
> don't really help understanding the purpose of the variables )
>
> >from django import forms
> >from django.forms.fields import ChoiceField
> >from myapp.models import *
> >
> >BOL_CODE_QUALIFIERS = (
> >  ('OB', 'Ocean Bill of Lading (OB)'),
> >  ('BM', 'House Bill of Lading (BM)'),
> >)
> >
> >class BolForm(forms.Form):
> >- scac = forms.ChoiceField(
> >- label=u'Ocean Carrier',
> >- choices=scac_choicelist()) ##
> >- bill_of_lading = forms.CharField(
> >- label=u'Bill of Lading #', max_length=50)
> >- bol_type = forms.ChoiceField(
> >- label=u'Type of B/L',
> >- choices=BOL_CODE_QUALIFIERS)
> >
> >Here's my model:
> >
> >from django.db import models
> >
> >class Scac(models.Model):
> >- code = models.CharField(max_length=4)
> >- name = models.CharField(max_length=60)
> >
> >- def __unicode__(self):
> >--- return self.code
> >
> >- def scac_choicelist():
> >--- q = Scac.objects.all()
> >--- scaclist = []
> >--- for x in q:
> >- scaclist.append((x.code, x.name))
> >- return scaclist
>
> Presuming the many "-"s represent indentation, "scac_choicelist" is
> a method of Scac. That means it should have at least one parameter: self
>
>def scac_choicelist(self):
>scaclist = []
>for item in self.objects.all():
>scaclist.append((item.code, item.name))
>return scaclist
>
> NOTE: based on your "-"s, your return statement is inside your loop, so
> you'd be returning after processing only one element.
>
>NOW... In the form module you need to reference an instance of the
> model! The method itself is not visible.
>
> >- scac = forms.ChoiceField(
> >- label=u'Ocean Carrier',
> >- choices=scac_choicelist()) ##
> >
>
> Something like:
>
>scac = forms.ChoiceField(   label=u"Ocean Carrier",
>
>  choices=Scac().scac_choicelist())
>
> --
>Wulfraed Dennis Lee Bieber AF6VN
>wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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: How to use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
Well, I put the code in line, thus:

class BolForm(forms.Form):
- q = Scac.objects.all()
- scaclist = []
- for x in q:
--- scaclist.append((x.code, x.name))
- scac = forms.ChoiceField(
- label=u'Ocean Carrier', choices=scaclist)
- bill_of_lading = forms.CharField(
- label=u'Bill of Lading #', max_length=50)
- bol_type = forms.ChoiceField(
- label=u'Type of B/L', choices=BOL_CODE_QUALIFIERS)

It worked.  But is there a better way?

On Fri, Jan 20, 2012 at 10:44 PM, Bill Beal  wrote:

> Hi All,
>
> When I looked in the docs for how to fill in the
> "choices=" attribute for a ChoiceField in a form,
> I could only find static sets of tuples for examples.
> I need to use a table from the DB for the tuples.
> I thought I could make up the choice list myself
> from the table, but I'm getting a Name Error:
> name 'scac_choicelist' is not defined at the marked
> line in my form:
>
> from django import forms
> from django.forms.fields import ChoiceField
> from myapp.models import *
>
> BOL_CODE_QUALIFIERS = (
>  ('OB', 'Ocean Bill of Lading (OB)'),
>  ('BM', 'House Bill of Lading (BM)'),
> )
>
> class BolForm(forms.Form):
> - scac = forms.ChoiceField(
> - label=u'Ocean Carrier',
> - choices=scac_choicelist()) ##
> - bill_of_lading = forms.CharField(
> - label=u'Bill of Lading #', max_length=50)
> - bol_type = forms.ChoiceField(
> - label=u'Type of B/L',
> - choices=BOL_CODE_QUALIFIERS)
>
> Here's my model:
>
> from django.db import models
>
> class Scac(models.Model):
> - code = models.CharField(max_length=4)
> - name = models.CharField(max_length=60)
>
> - def __unicode__(self):
> --- return self.code
>
> - def scac_choicelist():
> --- q = Scac.objects.all()
> --- scaclist = []
> --- for x in q:
> - scaclist.append((x.code, x.name))
> - return scaclist
>
> I didn't know where to stick the scac_choicelist()
> code, so I put it with the model.
>
> Questions:
> 1. Is this a reasonable approach?  If not, what?
> 2. If so, how can I get scaclist into the form?
>
> I hope there is enough info here that my mistake
> is obvious to somebody.
>
> 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.



Model-driven Django development

2012-01-20 Thread Alec Taylor
At University I've learned various techniques for model-driven
developments, such as:
- Class diagrams (generate code)
- ERD Diagrams (generate db code [e.g. SQL])

Can any of these sorts of—or for that matter, any sort of—model-driven
development techniques be used for 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.



Why can't erase this model object? "AssertionError: Question object can't be deleted because its id attribute is set to None."

2012-01-20 Thread Chris Seberino
I get the following error when attempting to delete an object of my
model...

"AssertionError: Question object can't be deleted because its id
attribute is set to None."

The class definition is thus...

class Question(django.db.models.Model):
"""
Represents a database table.
"""

subject = django.db.models.CharField(max_length = 1000)
section = django.db.models.CharField(max_length = 1000)
text= django.db.models.CharField(max_length = 1000)
answer  = django.db.models.CharField(max_length = 1000)
answer_type = django.db.models.CharField(max_length = 1000)

-- 
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 use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
Hi All,

When I looked in the docs for how to fill in the
"choices=" attribute for a ChoiceField in a form,
I could only find static sets of tuples for examples.
I need to use a table from the DB for the tuples.
I thought I could make up the choice list myself
from the table, but I'm getting a Name Error:
name 'scac_choicelist' is not defined at the marked
line in my form:

from django import forms
from django.forms.fields import ChoiceField
from myapp.models import *

BOL_CODE_QUALIFIERS = (
  ('OB', 'Ocean Bill of Lading (OB)'),
  ('BM', 'House Bill of Lading (BM)'),
)

class BolForm(forms.Form):
- scac = forms.ChoiceField(
- label=u'Ocean Carrier',
- choices=scac_choicelist()) ##
- bill_of_lading = forms.CharField(
- label=u'Bill of Lading #', max_length=50)
- bol_type = forms.ChoiceField(
- label=u'Type of B/L',
- choices=BOL_CODE_QUALIFIERS)

Here's my model:

from django.db import models

class Scac(models.Model):
- code = models.CharField(max_length=4)
- name = models.CharField(max_length=60)

- def __unicode__(self):
--- return self.code

- def scac_choicelist():
--- q = Scac.objects.all()
--- scaclist = []
--- for x in q:
- scaclist.append((x.code, x.name))
- return scaclist

I didn't know where to stick the scac_choicelist()
code, so I put it with the model.

Questions:
1. Is this a reasonable approach?  If not, what?
2. If so, how can I get scaclist into the form?

I hope there is enough info here that my mistake
is obvious to somebody.

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.



Re: ANN: Releasing Django Media Tree, a media file management application for the Django admin

2012-01-20 Thread Samuel Luescher
I'm not planning to create Fein CMS plugins myself, but I'm very much 
hoping the community will take a stab at this.
Actually, now that I think of it, the actual output generated by the CMS 
plugins should be abstracted from the CMS and moved to the 
media_tree.contrib.widgets package so that people can easily build on them.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FMW6EnGQe4IJ.
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.



Groups in Forms

2012-01-20 Thread James
I have a Jquery Notebook that has common options on one tab and more
advanced options on another tab.

The model referencing this data has both tabs of data and a
description field as well.

Initially, I broke out the form manually, but I decided that this
would be a major pain to write {{ formfield.label }}:{{ formfield }} for each and every single row, not to
mention to add in the custom error class for the field when it fails
to validate.

Then I decided to have three forms, one for each tab and a single
field form for description. But, in using forms.Forms you lose
Forms.save() and other shortcuts. So, to save back to an existing
model, I think, you need to break out each one again.

example:

m = models(pk=mypk)

m.date = form.cleaned_data['date']

and then you would have to do that for each line. This seems
inefficient to me.

For now, I'm using two model forms, excluding the fields of the
opposite tab in the modelform.

Example:

class TabOne(ModelForm):
class Meta:
model = models.models
exclude = ('stuff_from_tab_two',
   'stuff_from_tab_two',
   'stuff_from_tab_two',
   'stuff_from_tab_two')

and then again for TabTwo.

My question is:

Is it possible to break out a ModelForm into groups for display
purposes? It would be handy if in the Meta you could set a "break"
attribute that allowed you to break out different areas of the same
ModelForm

For example, in a model one might have:

Class Model(models.Models):
field_1 = models.IntegerField()
field_2 = models.IntegerField()
field_3 = models.IntegerField()
field_4 = models.IntegerField()
field_5 = models.IntegerField()
field_6 = models.IntegerField()
field_7 = models.IntegerField()
field_8 = models.IntegerField()
field_9 = models.IntegerField()
field_10 = models.IntegerField()

in the ModelForm:

class Form(ModelForm):
class Meta:
break = (('one',field_3),
 ('two',field_7),
 ('three',field_10),)


form = Form()
then to refer to form in a template, where you defined it as
'form':form, in the Context, it would be form['form_one'],
form['form_two'], form['form_three'].

Basically, the break would create a dictionary appending the name you
gave in the first part of the tuple to the name of the form.

Or anyway, something like that.

For now, I can't see a simple way to break out groups of a form. It
seems you have to either use the whole thing as intended or break it
up into individual parts in the template.

-- 
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: Need help with userena - assign user to group at signup

2012-01-20 Thread Jesramz
>you just make your choice in the backend depending what your database says

Would I have to go into the admin myself? (please, I have the mind of
a four year-old)

-- 
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: ANN: Releasing Django Media Tree, a media file management application for the Django admin

2012-01-20 Thread Gabriel - Iulian Dumbrava
Great job guys !!!

Why don't you list your Django CMS integration here: 
https://www.django-cms.org/en/extensions/  ?

Are you going to make some Fein CMS integration also? I believe that these 
two CMS systems are two of the best, and I like them both.

Gabriel

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/QyshSe6HLcsJ.
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: Need help with userena - assign user to group at signup

2012-01-20 Thread Andres Reyes
What do you mean with the employee choosing the employer option? You
normally don't give a choice in the frontend, you just make your
choice in the backend depending what your database says

2012/1/19 Jesramz :
>
>
> The problem with that, if I'm understanding correctly, is that a
> person who is meant to be an employee can easily choose the employer
> option. I want to add permissions such that an employer can see
> employee profiles while the employee can't (a separate form might add
> a tiny bit more security, I think). Can you help me with 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.
>



-- 
Andrés Reyes Monge
armo...@gmail.com
+(505)-8873-7217

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



DatabaseError: execute used with asynchronous query

2012-01-20 Thread j_syk
I was testing one my apps today with a form that features a drop-down
field that initiates a json lookup for additional detail. You choose a
location, it populates address fields. It's been working for weeks.
Today, when I clicked an entry, the target detail field didn't change.

I have debug off, so instantly I feel my phone buzz and I've been sent
a http500 report e-mail with the following message-


DatabaseError: execute cannot be used while an asynchronous query is
underway


I can't seem to reproduce the error, it's never happened before, and I
haven't changed this piece of code for a while, so I doubt it's
something new.

I'm willing to write it off as a fluke, but at the same time I'd like
to learn more and the search results on the topic don't seem good.

Server setup is Django 1.3.1, Gunicorn 0.13 with geventlet processes,
Nginx 0.7, postgres 8.4.8,
That particular page was using Jquery and a .getJSON call to a json
output produced by a django view which calls a basic query.

What should I know about the "asynchronous query" error? Are there
ways to prevent it? Should I be worried?

-- 
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: A problem with a solution, but is it the right one?

2012-01-20 Thread Jeff Heard
Yeah, I started doing that after I posted...  Thanks for the advice.  I'll
be posting this code up on GitHub in a few days, as it's part of a
reasonably complete implementation for Django of ISO 19142, Open Geospatial
Consortium's Web Feature Service.

-- Jeff

On Fri, Jan 20, 2012 at 7:30 AM, francescortiz wrote:

> I would pass bound data instead of calling from_request:
>
> https://docs.djangoproject.com/en/dev/ref/forms/api/#ref-forms-api-bound-unbound
>
> This way you don't have to worry about forms logic, but just about
> filling the default data.
>
> Francesc
>
> On Jan 18, 8:42 pm, Jeff Heard  wrote:
> > My basic problem is this: I have multiple kinds of requests that come in,
> > and some of them share parameters and valid values and default values. I
> > cannot expect my users to pass all form values on the URL line, but
> > unpassed parameters must be set to appropriate defaults, not merely None.
> >
> > These shared parameter sets are broken out into separate RequestForm
> > classes, but I also wanted to put the parsing and default values into
> those
> > classes. So I came up with the "from_request" method, which I put into
> each
> > RequestForm subclass and created a class method called "create" in
> > RequestForm that class every class in cls.mro()'s from_request method
> > independently, then calls .clean() on the form to validate it.
> >
> > Another caveat is that I must shadow the request.GET dictionary with a
> > case-insensitive dictionary, which I take care of in the
> > django.views.generic.View.dispatch() method.
> >
> > The code for my proposed solution is here:
> >
> > http://dpaste.com/hold/689872/
> >
> > Does this make sense to people?  Sorry to kind of flood the list with
> this
> > problem all day in different forms, but i think I'm close to having
> > something I like.
> >
> > -- Jeff
>
> --
> 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: A problem with a solution, but is it the right one?

2012-01-20 Thread francescortiz
I would pass bound data instead of calling from_request:
https://docs.djangoproject.com/en/dev/ref/forms/api/#ref-forms-api-bound-unbound

This way you don't have to worry about forms logic, but just about
filling the default data.

Francesc

On Jan 18, 8:42 pm, Jeff Heard  wrote:
> My basic problem is this: I have multiple kinds of requests that come in,
> and some of them share parameters and valid values and default values. I
> cannot expect my users to pass all form values on the URL line, but
> unpassed parameters must be set to appropriate defaults, not merely None.
>
> These shared parameter sets are broken out into separate RequestForm
> classes, but I also wanted to put the parsing and default values into those
> classes. So I came up with the "from_request" method, which I put into each
> RequestForm subclass and created a class method called "create" in
> RequestForm that class every class in cls.mro()'s from_request method
> independently, then calls .clean() on the form to validate it.
>
> Another caveat is that I must shadow the request.GET dictionary with a
> case-insensitive dictionary, which I take care of in the
> django.views.generic.View.dispatch() method.
>
> The code for my proposed solution is here:
>
> http://dpaste.com/hold/689872/
>
> Does this make sense to people?  Sorry to kind of flood the list with this
> problem all day in different forms, but i think I'm close to having
> something I like.
>
> -- Jeff

-- 
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-localeurl and SEO

2012-01-20 Thread ionic drive
thank you very much, I found out, that this issue is already addressed.
its possible to make multi_locale sitemaps with django-localeurl.

I did not see that this is possible in the first glance.
sorry!

link to tutorial:
http://packages.python.org/django-localeurl/usage.html#sitemaps

greetings
ionic

On Fri, 2012-01-20 at 11:48 +0100, Thorsten Sanders wrote:

> You could add sitemaps in the google webmaster tools or make a sitemap
> in the root dir which contains links to the other sitemaps.
> 
> On 19.01.2012 17:59, ionic drive wrote: 
> 
> > Hello django friends,
> > 
> > I have installed "django-localeurl" successfully. After some
> > redirecting troubles... don't worry ;-)
> > it works fine, but...
> > 
> > The Problem:
> > -
> > How is django-localeurl performe concerning SEO?
> > The "problem" is, if the browsers main language is "en" the
> > sitemap.xml links are created with
> > http://example.com/EN/websitename/foo.html
> >  if the browsers main language is "de"
> > the sitemap.xml links are created with
> > http://example.com/DE/websitename/foo.html
> >  if the browsers main language is "it"
> > the sitemap.xml links are created with
> > http://example.com/IT/websitename/foo.html
> >  if the browsers main language is "fr"
> > the sitemap.xml links are created with
> > http://example.com/FR/websitename/foo.html
> > 
> > Question:
> > 
> > So it again depends on the google-bot settings (language settings)
> > which urls are sent to google webindex.
> > Does google know, it should search with different bot settings, to
> > realize that there are multiple languages?
> > 
> > If NOT, than the solution without django-localeurl as we had it
> > before was far better.
> > 
> > Awaiting your professional SEO answers.
> > Thank you very much for helping me on that topic!
> > ionic -- 
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users
> > +unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users
> +unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

<>

Re: django-localeurl and SEO

2012-01-20 Thread Thorsten Sanders
You could add sitemaps in the google webmaster tools or make a sitemap 
in the root dir which contains links to the other sitemaps.


On 19.01.2012 17:59, ionic drive wrote:

Hello django friends,

I have installed "django-localeurl" successfully. After some 
redirecting troubles... don't worry ;-)

it works fine, but...

The Problem:
-
How is django-localeurl performe concerning SEO?
The "problem" is, if the browsers main language is "en" the 
sitemap.xml links are created with 
http://example.com/EN/websitename/foo.html
 if the browsers main language is "de" the 
sitemap.xml links are created with 
http://example.com/DE/websitename/foo.html 

 if the browsers main language is "it" the 
sitemap.xml links are created with 
http://example.com/IT/websitename/foo.html 

 if the browsers main language is "fr" the 
sitemap.xml links are created with 
http://example.com/FR/websitename/foo.html


Question:

So it again depends on the google-bot settings (language settings) 
which urls are sent to google webindex.
Does google know, it should search with different bot settings, to 
realize that there are multiple languages?


If NOT, than the solution without django-localeurl as we had it before 
was far better.


Awaiting your professional SEO answers.
Thank you very much for helping me on that topic!
ionic --
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: Need help with custom search using admin queryset

2012-01-20 Thread Raoul
Is there nobody using such extended search functions in Django?

Does anyone have a similar method for filtering querysets before
returning to admin result list?

Thanks for any hint!

-- 
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: Handling copy on a small project

2012-01-20 Thread Daniel Roseman
On Friday, 20 January 2012 04:39:44 UTC, Jeremy Boyd wrote:
>
> Hi all,
>
> For my side project, we have the need to rapidly iterate on the app's 
> copy. As I see it, we have two options: make copy db-driven, or hardcode it 
> into the templates. I'm leaning toward putting text in the db for now to 
> avoid having to teach our product guy the intricacies of commits and 
> deployment, but I'm curious a) whether I'm shooting myself in the foot, and 
> b) whether there are any go-to apps for this sort of thing.
>
> I'm able to give more background as necessary, but just curious whether 
> this question has an immediate answer.
>
> P.S.: Sorry if this has been asked before, but searching for "copy" and 
> "text" seems a bit futile after a few pages of results.
>
 
I'd vote for putting it in the db - you can use the built-in flatpages app, 
and even throw on a rich-text editor like TinyMCE if you need to.
--
DR.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/GM8B0S1NSaIJ.
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.