Hi,
my question is really basic but I'd like to make sure I'm doing the
right thing.
Say a user owns certain objects and it has the possibility to delete
them by clicking on a "delete" link.
I'm thinking of associating that link to a get request via a url like:
/objects/delete/
but this would g
Hi,
I'd like to use the manager method
Tag.objects.usage_for_model(MyModel,
filters=dict(field1__exact='value1')) from the django tagging
application. In my case MyModel has as attribute a foreign key to the
User model.
My problem is that I'd like to filter out the authenticated users (and
in an
Hi,
> Any chance you were using django-tagging previously and recently
> updated to trunk? There are backwards incompatible changes - the
> relation names have
> changed:http://code.google.com/p/django-tagging/wiki/BackwardsIncompatibleCha...
I was actually getting the same error before and af
Hi
> So the SQL that is being constructed by the joined queryset isn't valid.
> I'm almost certain the answer to this is "it's fixed in
> queryset-refactor, so will one day be fixed in trunk."
Thanks for the work you are doing:-)
> Pull the results back into Python and merge them manually.
Cou
Hi,
I'm using the latest version of the django tagging application (rev.
132) and I'm having problems with the get_by_model method of the
TaggedItem manager.
Say I have a QuerySet1 generated as follow:
QuerySet1 = TaggedItem.objects.get_by_model(MyModel, 'tag1')
and a QuerySet2 generated as foll
Hi,
I'm a bit puzzled by the following behaviour of newforms.
I have a field in the form called 'seller'.
In the form validation I have a clean_seller method which if a certain
condition is verified will do the following:
self.errors.update(seller = ErrorList([u"message1: the indicated
seller
Hi,
I recently started using the django-tagging application. The Tag and
TagItem models have each a field which is indexed (db_index=True).
Does loading data with json fixtures change because of having
db_index=True?
When the data are loaded via fixtures is the save method called on
each loaded i
se of SQLite lack of reg-
exp support? If that's the case then the code has to be changed when
moving to production (that is, likely to a different database
platform)?
Thanks again
Francesco
On Nov 20, 12:58 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Mon, 2007-11-19 at 1
Do you have any suggestion on what could be wrong?
Thanks again
Francesco
On Nov 19, 1:52 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Sun, 2007-11-18 at 12:46 -0800, cesco wrote:
> > Hi,
>
> > I have the following query which works perfectly with sqlite3:
>
&
Hi,
I have the following query which works perfectly with sqlite3:
from django.db import models
qs.filter(models.Q(myField__iregex="\\b%s\\b" % myString)
In the production server, where I'm running postgresql the exact same
query is not working.
Do you have any idea why this happens? Maybe a bu
Hi,
I have two querysets: qs_big and qs_small with qs_small subset of
qs_big (that is, all the objects in qs_small are also objects of
qs_big). I'd like to obtain a queryset of objects which are in qs_big
but not in qs_small.
If exclude could accept a queryset as parameter I would do something
li
Hi,
I have two QuerySets and I need to join them to pass them as first
parameter to the ObjectPaginator class.
How can I do that?
The "+" operator doesn't work (like it does for lists) and there is no
a method like the list one "extend()".
Any suggestion would be very appreciated.
Best regards
"Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 9/20/07, cesco <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I'd like to test a query and the data returned by that query is a list
> > containing a list of objects. For example:
&g
Hi,
I'd like to test a query and the data returned by that query is a list
containing a list of objects. For example:
[[, , ..., ]]
If I try testing using unittests I get the following error:
AssertionError: [[]] != [[]]
though to me the expected output and the one I get look identical.
If I tr
Hi,
is it possible to do filtering based on a method or a property of the
model?
Say I have a model with a from_date field and a to_date field and a
method, defined within the model, which checks if the model instance
is current, that is:
from datetime import date
@property
def is_current(self):
Hi,
I'd like to make a filter composed by ORing several Q objects, each of
which acts on a different model field.
For example I have a model with the fields "name", "title",
"description" and I want to make a Q object like the following:
Q_name = (Q(name__istartswith="hello") & Q(name__icontains=
Hi
> I'm using this snippet which works fine.
Which snippet?
Thanks
Francesco
--~--~-~--~~~---~--~~
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.c
In the current django documentation is written that the create_object
generic view (from django.views.generic.create_update) returns as
template context the "form" variable which is an instance of
django.oldforms.FormWrapper. Is there a way to use new forms?
Thanks and regards
Francesco
--~--~-
Thanks a lot Malcolm, I think we are getting there:-)
> So, have a look at the debug screen and click on the "local variables"
> link just below this last line in the extended traceback. What is "s"
> here (in particular, it would be good know what type(s) is)? Also, what
> is the value of 'encod
Thanks for your replies.
Just to avoid any doubt, I'm using __unicode__ instead of __str__ and
I'm using the latest development version of django (post unicode
merge).
> What is most important to know is (a) what is the data that it is
> trying to render (both type and content).
It's trying to
Hi,
I'm using sqlite3 as db for my django project.
In order to load the data in the db I first generated a unicode string
(which contains danish characters "ø, æ, å") and dumped such a string
to a file (in json format) as follows:
f_hdl = file(json_offers_path, 'w')
f_hdl.write(offer_entry.encode
Hi,
I need to retrieve automatically some information from an e-commerce
site.
The site doesn't offer any API, so the only way to perform the search
is via the form they provide. The form is submitted via a POST method
and the URL doesn't change after clicking the search button even if I
select d
Hi,
is there any rough estimate on when the full-text indexing branch will
be integrated into trunk?
Thanks
Francesco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, se
Thanks but I was asking for something more precise, like latitude and
longitude (approximated, of course) rather than the country which
would be too vague for my application. Any other suggestion?
Thanks again
On Jul 16, 1:07 pm, xaranduu <[EMAIL PROTECTED]> wrote:
> cesco schrieb:
Hi,
does anyone in the django community know of a public algorithm to get
the location from the ip.
If such a thing doesn't exist do you know of a service with an API
which does it?
Or maybe such a functionality will be available with the upcoming
Geodjango?
Many thanks
Francesco
--~--~---
Thanks:-)
On Jul 11, 3:10 am, Nathan Ostgard <[EMAIL PROTECTED]> wrote:
> On Jul 10, 2:58 pm, novice <[EMAIL PROTECTED]> wrote:
>
> > but I get error that the offers_offerprice.offerseller_id column
> > doesnt exist.
>
> I think you're missing an underscore. Your model has the field named
> offer
Hi,
in django we can chain multiple filter methods like:
MyModel.objects.filter(field1__exact=value1).filter(field2__exact=value2)
but I'd like to be able to chain custom filter methods defined by
extending the models.Manager class.
For example:
MyModel.objects.filter(field1__exact=value1).my_
Hi,
I've created a MyManager class (extending models.Manager) to provide
some custom filtering methods, then in the related
MyModel(models.Model) class I put
objects=MyManager()
so I have the custom filtering methods available as
MyModel.objects.my_filter().
Now I'd like to be able to chain the c
Hi,
I'd simply like to know whether there is a rough estimate of when the
geodjango branch will be merged trunk.
Thanks
Francesco
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to th
Hi,
I'm using the django-voting application whose method
get_votes_in_bulk(object) returns a "votes" dictionary like:
{object_id: {''score': score, 'num_votes': num_votes}
I'm passing this dictionary as extra_context to a template where I'm
also using the regroup tag on theobjects which I pass a
Hi,
I'm using the django-voting application whose method
get_votes_in_bulk(object) returns a "votes" dictionary like:
{object_id: {''score': score, 'num_votes': num_votes}
I'm passing this dictionary as extra_context to a template where I'm
also using the regroup tag on theobjects which I pass a
Hi,
I'm trying to apply the patch given in http://code.djangoproject.com/ticket/3297
using tortoiseSVN on windows but I get the following error message:
The line "Index: " was not found
Either this is not a diff file or the diff is empty.
The file I downloaded and used as patch is:
http://code.
Hi,
I'd like to implement in my own views the filter functionality that is
available in the admin by setting
class Admin:
list_filter = ('field_name1', 'field_name2',)
I went through the html of the admin and I kind of understand that
it's related to the generation of hidden input fields wh
Hi,
I have the following query which I cannot implement with the django
model API because I need to order it according to a calculated field.
query = """SELECT id FROM offers_offer AS f1
ORDER BY (f1.original_price-f1.discounted_price) DESC
LIMIT 20"""
cursor = connection.cursor()
cur
On Jun 3, 6:52 pm, sansmojo <[EMAIL PROTECTED]> wrote:
> The raw, binary data of the file. After uploading, it ends up at
> request.FILES['file']['content'] (where 'file' is the name of your
> form field).
>
> An example:
>
> if request.FILES.has_key('file'):
> new_file = File(some_field='som
In the following method available for FileFields:
save_FOO_file(filename, raw_contents)
what does "raw_contents" represents?
I didn't find any example on the web about it.
Many thanks
Francesco
--~--~-~--~~~---~--~~
You received this message because you are sub
> Can you tell us more info about your view code ?
Thanks for the quick response!
in the view I have the following
if request.method == 'POST':
form = AddOfferForm(request.POST)
if form.is_valid():
#new_offer = form.save()
Offer.objects.create(name=form.cleaned
I have a model called Offer containing, besides other fields, a
picture field as in the following example:
class Offer(models.Model):
picture = models.ImageField(null=True, blank=False, unique=False,
upload_to='offers/')
I created a form for adding Offer objects as follows:
class AddOfferFo
Hi,
I'm experiencing a problem loading some data from fixtures. Some of
the object loaded have danish letters (ø, å, æ) in their fields.
If I use the ANSI encoding for the JSON file I'm trying to load I get
the following error message:
"Problem installing fixture ...: 'utf8' codec can't decode b
Hi,
I'm trying to render a template using a generic view of the
list_detail type. The list of objects I'm trying to render in the
template (which are offers) have an original_price and a
discounted_price and I'd like to display also the relative discount
(that is: (original_price-discounted_price
table.
Any other suggestion?
Thanks again
Francesco
On May 14, 3:28 pm, Martin Winkler <[EMAIL PROTECTED]> wrote:
> Hi Francesco,
>
> Am Mon, 14 May 2007 12:44:46 -
> schrieb cesco <[EMAIL PROTECTED]>:
>
> > query = """SELECT id FROM my_table \
I have to execute the following SQL query:
query = """SELECT id FROM my_table \
WHERE my_table.some_id IN %s"""
cursor.execute(query, [(1, 2, 3)])
and the aim would be to replace the %s with the tuple (1, 2, 3) but I
get the following error:
Traceback (most recent call last):
42 matches
Mail list logo