Re: Django training resources?

2010-12-17 Thread mengu
hi,

i think you should definitely watch this screencast series:
http://showmedo.com/videotutorials/video?name=336&fromSeriesID=336

On Dec 18, 1:12 am, Sean W  wrote:
> Is anyone aware of good quality, affordable training for Django?  I'm
> entirely new to web development, although I do have some experience with
> Python. I'm also a college student, so cost is a concern. I don't have the
> time to travel to a training seminar. I'm not one of those people who can
> master a subject simply by reading a book or tutorial–I need some hands on
> experience. Something like a webinar would work, even a pre-recorded one.
>
> Any suggestions are appreciated. 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Djangoweek.ly, a Django weekly newsletter

2010-12-21 Thread mengu
nice idea Jon. subscribed!

On Dec 21, 2:00 pm, Jon Atkinson  wrote:
> Hello,
>
> I just wanted to drop a quick note to promote Django Weekly, a new weekly
> Django newsletter which I'm putting together. I'm looking to send the first
> issue around the 1st of January. Hopefully this will be of interest to some
> of the members of this list.
>
> http://djangoweek.ly/
>
> Cheers,
>
> --Jon

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



Re: Django real world website samples (with django source codes)

2011-04-08 Thread mengu
go to http://github.com and http://bitbucket.org and search for
django.

On Apr 8, 5:21 am, djangodjango django  wrote:
> thanks.
>
>
>
>
>
>
>
> On Thu, Apr 7, 2011 at 4:38 PM, Nikos K  wrote:
> > Here is a list with a lot of sites based in django
>
> >http://www.djangosites.org/
>
> > 
>
> > On 7 April 2011 08:48, django beginner  wrote:
>
> >> Hi all,
>
> >> Could someone please give a link on some of the samples for real world
> >> Django websites?
> >> Thanks and have a nice day!
>
> >> Regards,
> >> Django Beginner
>
> >> --
> >> 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 have different logo for django admin based on URL

2011-04-10 Thread Mengu
I don't know if there is a Django way for this, however this can be
achived very easily with javascript.

On Apr 9, 2:36 am, rahul jain  wrote:
> Anyone ever tried to have different logos for admin based on the URL
>
> Like
>
> http://url/comp1
>
> use comp1 logo for django admin always
>
> http://url/comp2
>
> use comp2 logo for django admin always
>
> Thanks.
>
> Rahul

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

2011-04-10 Thread Mengu
i believe you can do this with "extra" attribute.

go to http://docs.djangoproject.com/en/1.3/ref/models/querysets/ and
search for subquery. you'll see how to do subqueries.

On Apr 6, 5:30 pm, bernatbonet  wrote:
> Data Model:
> class A(models.model):
>    desc: model.CharField()
> class B(models.model):
>    a: model.ForeignKey('A')
>    desc: models.CharField()
> I need to do this select in a view:
>    select max(num_a) as max_num_a from (select a, count(desc) as
> num_a
> from B group by a) as x;
> I've tried this:
>    result =
> B.objects.values('a').annotate(num_a=Count('a')).aggregate(Max('num_a'))
> And I got this error:
>    1064, "You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'FROM (SELECT `B`.a` AS `a`, COUNT(`a' at line 1")
> If we only group and not obtain max it works:
>    result = B.objects.values('a').annotate(num_a=Count('a'))
> and the result is : {'a': 1L, 'num_a': 9}{'a': 2L, 'num_a': 6}{'a':
> 3L,
> 'num_a': 4}
> I'm not sure what I'm doing wrong, neither if there's other way to
> resolve it.
> If somebody have been faced with and resolved it, I'll be gratefull if
> he can show me how can I start for beating this.
> Thanks all.

-- 
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: What do you use to build facebook applications with django?

2011-04-11 Thread Mengu
facebook api is all about asking for it to do something and getting
the response of it. what are you stuck with?

On Mar 16, 5:46 pm, mongoose  wrote:
> Hi,
>
> I've been struggling so much trying to get a Facebook app to work on
> the Django framework. Mostly battling with pyFacebook. For some
> particular reason the login just doesn't work for me. I've posted some
> help questions and still come up with nothing. Perhaps the pyFacebook
> is outdated?
>
> But my question is What do you use to build facebook applications with
> django? Why am I having such a hard time when I believe this is
> supposed to be reasonably easy to accomplish.

-- 
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: best practice override admin 1.2 "delete"?

2011-04-14 Thread Mengu
you can override the delete method for your models and set a column
ie, is_deleted to True or something else in there. so, subclass
models.Model, override delete option and your models should extend
your new subclass.

On Apr 14, 11:51 am, λq  wrote:
> Hi list,
>
> We have a production django app using the default admin view, but some of
> the super users delete a record in a model and affect other related data,
> this cause inconsistency and corruption. What's the best practice to
> override django admin's default delete behavior and implement some kind of
> "Recycle Bin" for models without harassing much the existing code?
>
> Any idea is appreciated. Thanks in advance!

-- 
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 variables in settings.py on template + how to use the media

2011-04-14 Thread Mengu
this will help you out:
http://stackoverflow.com/questions/433162/can-i-access-constants-in-settings-py-from-templates-in-django/433209#433209

On Apr 14, 4:33 pm, GKR  wrote:
> please 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: how to use variables in settings.py on template + how to use the media

2011-04-14 Thread Mengu
sorry, i've got you wrong. i thought you wanted to use the constants
in your views which were defined in your settings.py file.

your real problem is about serving static files. reading
http://docs.djangoproject.com/en/dev/howto/static-files/ will help
you.

On Apr 14, 5:03 pm, GKR  wrote:
> plz help on how to use my custom images and css

-- 
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: Stackoverflow kind of Answer/commenting app in Django

2011-04-14 Thread Mengu
doesn't pinax provide something like this?

On 14 Nisan, 21:44, AJ  wrote:
> >>Here's a fun thought, why can't a custom blog  like enty and the comments
> >>framework be utilized to do this?
>
> Precisely but I was hoping I'd get something with modifications.
>
> Here is what I require:
>
> * Posts in the system: bunch of text. --- (This i already have.)
> * Each post gives user to be able to comment/answer.
> * Each of these answers/comments can have votes
> * Each comment/answer gives users the ability to comment on those
> answers/comments.
>
> I was hoping that there would be a pluggable app to do this. Django comments
> alone cannot achieve the Stackoverflow effect.

-- 
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: best practice override admin 1.2 "delete"?

2011-04-15 Thread Mengu
Hi,

I've just asked in the #django channel. Read this
http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.queryset.

On Apr 15, 6:27 am, λq  wrote:
> Thanks Mengu,
>
> I have another question:
>
> how to set admin's default view NOT to display items if is_deleted=True?
>
> Yes the super user can click a filter link, but I want to make it as default
> as possible.
>
>
>
>
>
>
>
> On Thu, Apr 14, 2011 at 8:21 PM, Mengu  wrote:
> > you can override the delete method for your models and set a column
> > ie, is_deleted to True or something else in there. so, subclass
> > models.Model, override delete option and your models should extend
> > your new subclass.
>
> > On Apr 14, 11:51 am, λq  wrote:
> > > Hi list,
>
> > > We have a production django app using the default admin view, but some of
> > > the super users delete a record in a model and affect other related data,
> > > this cause inconsistency and corruption. What's the best practice to
> > > override django admin's default delete behavior and implement some kind
> > of
> > > "Recycle Bin" for models without harassing much the existing code?
>
> > > Any idea is appreciated. Thanks in advance!
>
> > --
> > 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: best practice override admin 1.2 "delete"?

2011-04-15 Thread Mengu
glad it did work :)

On Apr 15, 10:32 am, λq  wrote:
> Wow, this is exactly what I am looking for. Thanks a million! :D
>
> 2011/4/15 Mengu 
>
>
>
>
>
>
>
> > Hi,
>
> > I've just asked in the #django channel. Read this
>
> >http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...
> > .
>
> > On Apr 15, 6:27 am, λq  wrote:
> > > Thanks Mengu,
>
> > > I have another question:
>
> > > how to set admin's default view NOT to display items if is_deleted=True?
>
> > > Yes the super user can click a filter link, but I want to make it as
> > default
> > > as possible.
>
> > > On Thu, Apr 14, 2011 at 8:21 PM, Mengu  wrote:
> > > > you can override the delete method for your models and set a column
> > > > ie, is_deleted to True or something else in there. so, subclass
> > > > models.Model, override delete option and your models should extend
> > > > your new subclass.
>
> > > > On Apr 14, 11:51 am, λq  wrote:
> > > > > Hi list,
>
> > > > > We have a production django app using the default admin view, but
> > some of
> > > > > the super users delete a record in a model and affect other related
> > data,
> > > > > this cause inconsistency and corruption. What's the best practice to
> > > > > override django admin's default delete behavior and implement some
> > kind
> > > > of
> > > > > "Recycle Bin" for models without harassing much the existing code?
>
> > > > > Any idea is appreciated. Thanks in advance!
>
> > > > --
> > > > 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: How to send email from html?

2011-04-17 Thread Mengu
that is actually jquery code, mixed with a django template variable.

$ is an alias for jquery which lets you do some nice things with it.
you can also replace it with "jQuery('#send_..')".

#send_{{ forloop.counter }} means the element with id "send_x". x
there is whatever the current forloop.counter is.

so the whole code "$('#send_{{ forloop.counter }}').submit();" means
"submit the dom element which has the id of 'send_x'"

On Apr 17, 6:47 pm, LIU Liang  wrote:
> I want to realize the e-mail verification for the social network.
> But not clear about the code below:
> what does the '$' and the '#' mean? and the method 'submit()?
>
>     {% trans "re-send
> verification e-mail" %}
>
> I want that after clicking the button 'Verify', it should send out an
> e-mail. However, I have copied the apps account and emailverfication
> to my project. but it doesn't work. I need help please.

-- 
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 find if a record changed

2011-04-17 Thread Mengu
i believe it does. you can override the "save" method of your model
like this:

from django.db import models
from datetime import datetime

# Create your models here.
class TestModel(models.Model):
first_field = models.CharField(max_length=255)
second_field = models.BooleanField()
updated_at = models.DateTimeField(default=datetime.now)

def save(self, *args, **kwargs):
if hasattr(self, 'id') and getattr(self, 'id') is not None:
self.updated_at = datetime.now()
super(TestModel, self).save(*args, **kwargs)

On Apr 17, 6:25 pm, Aref  wrote:
> Hello,
>
> I have a text field which could be updated regularly and I want to
> automatically attach a date every time the record is updated--but only
> if the record is updated. Can this be done in django and how would I
> go about doing it.
> 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: best practice override admin 1.2 "delete"?

2011-04-17 Thread Mengu
while i was reading the docs, i've noticed something and felt like i
should warn you. my suggestion is not the best practice if you are
doing something like
"Model.objects.filter(some_field=some_value).delete()". for deletions
like that you should use pre_delete signal [1].

[1] 
http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_delete

good luck.

On Apr 14, 3:21 pm, Mengu  wrote:
> you can override the delete method for your models and set a column
> ie, is_deleted to True or something else in there. so, subclass
> models.Model, override delete option and your models should extend
> your new subclass.
>
> On Apr 14, 11:51 am, ëq  wrote:
>
>
>
>
>
>
>
> > Hi list,
>
> > We have a production django app using the default admin view, but some of
> > the super users delete a record in a model and affect other related data,
> > this cause inconsistency and corruption. What's the best practice to
> > override django admin's default delete behavior and implement some kind of
> > "Recycle Bin" for models without harassing much the existing code?
>
> > Any idea is appreciated. Thanks in advance!

-- 
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: Detecting form mode in admin (create, edit, delete)

2011-04-18 Thread Mengu
you mean like if a new object is being added or edited in the admin?

On Apr 18, 1:58 pm, Sithembewena Lloyd Dube  wrote:
> Hi all,
>
> I wish to find out how I can detect current form mode in admin.py. What I am
> trying to do is to stop users changing a dropdown's selection when in edit
> mode.
>
> Any ideas?
>
> 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: Detecting form mode in admin (create, edit, delete)

2011-04-18 Thread Mengu
well, that could be done via javascript. :)

http://localhost:8000/admin/testapp/testmodel/2/ - means i'm updating
http://localhost:8000/admin/testapp/testmodel/add/ - means i'm adding

if (document.location.href.indexOf("/add/") != -1) {

}

On Apr 18, 2:50 pm, Sithembewena Lloyd Dube  wrote:
> @Mengu, yes, precisely :)
>
>
>
>
>
>
>
>
>
> On Mon, Apr 18, 2011 at 1:20 PM, Mengu  wrote:
> > you mean like if a new object is being added or edited in the admin?
>
> > On Apr 18, 1:58 pm, Sithembewena Lloyd Dube  wrote:
> > > Hi all,
>
> > > I wish to find out how I can detect current form mode in admin.py. What I
> > am
> > > trying to do is to stop users changing a dropdown's selection when in
> > edit
> > > mode.
>
> > > Any ideas?
>
> > > 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.
>
> --
> 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: Detecting form mode in admin (create, edit, delete)

2011-04-18 Thread Mengu
sorry, accidentally posted.

well, that could be done via javascript. :)
http://localhost:8000/admin/testapp/testmodel/2/ - means i'm updating
http://localhost:8000/admin/testapp/testmodel/add/ - means i'm adding

if (document.location.href.indexOf("/add/") == -1) {
// do not let update.
}

On Apr 18, 3:56 pm, Mengu  wrote:
> well, that could be done via javascript. :)
>
> http://localhost:8000/admin/testapp/testmodel/2/- means i'm 
> updatinghttp://localhost:8000/admin/testapp/testmodel/add/- means i'm adding
>
> if (document.location.href.indexOf("/add/") != -1) {
>
> }
>
> On Apr 18, 2:50 pm, Sithembewena Lloyd Dube  wrote:
>
>
>
>
>
>
>
> > @Mengu, yes, precisely :)
>
> > On Mon, Apr 18, 2011 at 1:20 PM, Mengu  wrote:
> > > you mean like if a new object is being added or edited in the admin?
>
> > > On Apr 18, 1:58 pm, Sithembewena Lloyd Dube  wrote:
> > > > Hi all,
>
> > > > I wish to find out how I can detect current form mode in admin.py. What 
> > > > I
> > > am
> > > > trying to do is to stop users changing a dropdown's selection when in
> > > edit
> > > > mode.
>
> > > > Any ideas?
>
> > > > 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.
>
> > --
> > 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: My tool to generate django code

2011-05-22 Thread Mengu
I also did like it as well. however I wouldn't feel secure when I
started a new start-up project so open sourcing the application would
be very neat, imho.

congratulations and thanks anyway! :)

On May 22, 7:54 am, Brice Leroy  wrote:
> Hello guys,
>
> I posted a while ago about my project on this forum. Some liked it some kind
> of hated it (weird)... I though I would post here for updates.
>
> Django Generator is a tool to build django skeleton of your app (model,
> form, view, templates...). I tried to make sure it covers enough surface but
> doesn't go too deep so you just have to focus on specific tuning and coding.
>
> The new features:
>
> - There is a first shot of public project. Not sure where this option will
> go (fork, clone, collaborative work...)
> - Fields can now be collapsed (wow... this took a while I know) and displays
> their python transcription.
> - Help got included per field option
> ... and some code fixes and improvements.
>
> I also added a screenshot as people where complaining to have to register to
> use/see the tool. I'm not yet sure about the benefit of using the tool
> without registration.
>
> As every creator/coder I'd like to get a peer review :-)
>
> Good night folks.
>
> Brice
>
> --
> blog:http://www.debrice.com
> Time tracking tool:http://alpha.kaaloo.com
> Django site generator:http://alpha.djangogenerator.com
> linkedin:http://www.linkedin.com/in/bricepleroy

-- 
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: Finding a developer

2012-06-24 Thread Mengu
well, it may be hard to find if you require their presence otherwise
you will find many great developers who are looking for remote full/
part time work.

On Jun 24, 11:35 pm, "Bob Carlson"  wrote:
> I have been planning to implement my backend server in Django/Python but I am
> still in the early phases. I thought I ought to look into Ruby on Rails as 
> well.
> The technical articles comparing them come out pretty even. It appears that
> there is perhaps three times as much RR activity out there as Django/Python. I
> am doing prototype work myself right now, but I will need professional help
> eventually. That led me to my question.
>
> Is it easier to find a Django developer or a Rails developer? Despite there
> being more activity around Rails, the availability of developers may not 
> follow.
> Also, is there any difference in cost?
>
> Cheers, Bob
>
> Bob Carlson | +1 719 571 9228 (office)  | +1 541 521 9525 (mobile)
>
> b...@rjcarlson.com  | rjcarlson49 (aim or skype)

-- 
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 group models month by month.

2011-09-06 Thread Mengu
this is overkill. the query you actually need is this (there even can
be a better way):

SELECT DATE_FORMAT(pub_date, "%Y %M") as pub_date, COUNT(*) as count
FROM app_posts
GROUP BY pub_date
ORDER BY count DESC

i have no idea how to pull this query by the Django ORM but you can
run this as a raw query like this:

Post.objects.raw("SELECT DATE_FORMAT(pub_date, "%Y %M") as pub_date,
COUNT(*) as count FROM app_posts GROUP BY pub_date ORDER BY count
DESC")

kolay gelsin.


On Sep 6, 5:30 pm, Yaşar Arabacı  wrote:
> I already read that, but I can figure out it is something to do with my
> question, bu can't figure out what exactly should I do with aggreates. I
> ended up doing something like this:
>     query_set = Post.objects.all()
>     years = query_set.dates("pub_date","year")
>     date_hierarchy = {}
>     for year in years:
>         date_hierarchy[year] = {}
>         months =
> query_set.filter(pub_date__year=year.year).dates("pub_date","month")
>         for month in months:
>             date_hierarchy[year][month] =
> query_set.filter(pub_date__year=month.year,pub_date__month=month.month).count()
>
> Then in template:
>
> {% for year, month_dict in date_hierarchy.items %}
> {% for month,post_count in month_dict.items %}
> {{ month|date:"Y
> E" }} [{{ post_count }}]
> {% endfor %}
> {% endfor %}
>
> 2011/9/6 Andre Terra 
>
>
>
>
>
>
>
>
>
> >http://django.me/aggregation
>
> > Cheers,
> > AT
>
> > 2011/9/6 Yaşar Arabacı 
>
> >> I have a model with datetime field. I want to get a table with three
> >> columns as, year, month and number of items in time span. And I also want 
> >> to
> >> order them from newest to oldest. What I want to get is something like 
> >> this:
>
> >> 2011 August 4
>
> >> 2011 March 7
>
> >>  How do you suggest I should do that?
>
> >> I am trying to add post archives to my front page in my blog. Here is link
> >> to same question on StackOverflow:
> >>http://stackoverflow.com/q/7320662/886669
> >>  --
> >>http://yasar.serveblog.net/
>
> >>  --
> >> 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.
>
> --http://yasar.serveblog.net/

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

2011-09-22 Thread Mengu
django from the ground up series is good.

watch at http://showmedo.com/videotutorials/series?name=PPN7NA155

On Sep 22, 8:18 am, ANKUR AGGARWAL  wrote:
> Hey
> I am currently searching for django video tutorials. I am unable to find
> them on web. Was expecting them at lynda.com but they doesn't provide any
> type of django tuts. So please provide me the links :)
> Thanks in advance :)
>
> Regards
> Ankur Aggarwal

-- 
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: Which Linux distro to use on EC2?

2011-11-13 Thread Mengu
if i had to choose a linux distro, i'd go with debian. however if i
can choose whatever i want then i'd go with freebsd. we are using
freebsd on 6 web servers and debian on 2 with the same hardware
configuration freebsd is outperforming debian.

On Nov 13, 9:56 pm, ydjango  wrote:
> I am setting up nginex, apache, python django, mysql based application
> on EC2. I expect high web traffic and high mysql query usage. Mysql
> and web server will on seperate servers.
>
> Which linux distro should I use for heavy production use - Ubuntu,
> Centos or Debian?
>
> Does it matter?
>
> I see most instructions on web is using Ubuntu and it seems it is
> considered easiest to set up. But I read somewhere that Ubuntu is not
> for server use. What is the downside if I chose ubuntu?

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

2011-11-22 Thread Mengu
there are tons of django apps. you can search them, install and use in
your application without any problems.

for example for your rich text editor need, you can use django-
ckeditor application. it also gives you the possibility of browse and
upload images on the fly.

for the rest of your needs search http://djangopackages.com/ and
http://www.django-apps.com/.

good luck.

On Nov 23, 6:24 am, "michael.grant"  wrote:
> I'm about to embark on a project that's well suitable to a web framework.
>  I've had my eye on django for a couple years now but haven't done anything
> more than work through the basic tutorial so far.
>
> There's a handful of things I need to do over and over and I'm not sure if
> these are part of django or some other toolkit.
>
> 1) I need to have an easy way to upload and manage images
> 2) Some of the text boxes on the site need to be rich text, I'll need
> something like fckeditor or some other rich text (html) editor
> 3) I need a combo-box widget which presents a list of choices and a text
> field.  If the user doesn't find what they want in the list, they enter a
> new item as text.  As they type, the possible choices are given to them.
>  I'm not sure what this is called, I'd call it a
> combo-box-with-auto-complete-and-auto-add.
> 4) Grids with virtual scrolling
>
> It seems like I should not have to re-invent the wheel.  Is there a set of
> widgets that I can use with django to do these sort of things (and more)?
>  I've seen the documentation on the built-in widgets but they all seem very
> basic.

-- 
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: Best way to upload and play a video

2011-12-11 Thread Mengu
if you are having problems with the django basics then you have to re-
do the django tutorial at 
https://docs.djangoproject.com/en/1.3/intro/tutorial01/.

here is your work flow:

* create your django application.
* create your models.
* build an upload form.
* get the user input.
* save it to your database.
* use jwplayer or flowplayer to play the video.

On 11 Aralık, 23:32, Hassan  wrote:
> i want to use a normal flash player , and after i make the models do i
> need to make somthing else so i can upload files , and i having a
> problem of how making a form that can fill a table in models !!! am
> new to djang :(

-- 
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: Initial data for dynamic field

2011-12-23 Thread Mengu
you need to set "initial" attribute of TypedChoiceField.
On Dec 23, 10:34 am, Martin Tiršel  wrote:
> Hello,
>
> I have:
>
> class SomeForm(forms.Form):
>      ...
>
>      def __init__(self, *args, **kwargs):
>          ...
>          super(SomeForm, self).__init__(*args, **kwargs)
>          ...
>          self.fields['starting_location'] = forms.TypedChoiceField(
>              label=_('Starting location'),
>              choices=DIRECTIONS_CHOICES,
>              coerce=int
>          )
>
> Now I want to choose as initial selection one random item from
> DIRECTIONS_CHOICES choices but I have to do it in this __init__() method
> (not in view!). How can I achieve this?
>
> Thanks,
> Martin

-- 
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: Ember.js or Backbone.js for Django?

2011-12-23 Thread Mengu
they both belong to the template concept of django. you can write down
your front-end with ember or backbone and write your back-end with
django models and views. it is all up to your tastes and requirements
to use one of the two.

On Dec 23, 2:05 am, Jesramz  wrote:
> Which of these is best suited to work with 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.



Re: Running html files in /var/www alongwith Django over Apache

2011-12-23 Thread Mengu
hi nipun,

please go read about the DocumentRoot directive [1] and VirtualHosts
[2] in Apache.

[1] http://httpd.apache.org/docs/2.2/mod/core.html#documentroot
[2] http://httpd.apache.org/docs/2.2/vhosts/

On Dec 23, 8:06 am, nipun batra  wrote:
> Hi,I got my Apache Mod_WSGI and Django working 
> followinghttp://blog.stannard.net.au/2010/12/11/installing-django-with-apache-...
> a twist that my 000-default site has the contents
>
> 
>     ServerAdmin webmaster@localhost
>      DocumentRoot /home/nipun/webdev/demo/demo
>
>         
>         Order allow,deny
>         Allow from all
>
>         WSGIDaemonProcess demo.djangoserver processes=2 threads=15
> display-name=%{GROUP}
>         WSGIProcessGroup demo.djangoserver
>
>         WSGIScriptAlias / /home/nipun/webdev/demo/demo/apache/django.wsgi
>         
>
>     DocumentRoot /var/www
>     
>         Options FollowSymLinks
>         AllowOverride None
>     
>     
>         Options Indexes FollowSymLinks MultiViews
>         AllowOverride None
>         Order allow,deny
>         allow from all
>     
>
>     ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
>     
>         AllowOverride None
>         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>         Order allow,deny
>         Allow from all
>     
>
>     ErrorLog ${APACHE_LOG_DIR}/error.log
>
>     # Possible values include: debug, info, notice, warn, error, crit,
>     # alert, emerg.
>     LogLevel warn
>
>     CustomLog ${APACHE_LOG_DIR}/access.log combined
>
>     Alias /doc/ "/usr/share/doc/"
>     
>         Options Indexes MultiViews FollowSymLinks
>         AllowOverride None
>         Order deny,allow
>         Deny from all
>         Allow from 127.0.0.0/255.0.0.0 ::1/128
>     
>
> 
>
> So using this configuration i can basically run my Django sites 
> likehttp://localhost/metafor instance where meta calls corresponding view
>
> However now when i try to load index.html(which has some javascript and
> html code) lying on my /var/www it tries to match that using URL's
> specified in urls.py of my Django project which i have configured with
> Apache.
>
> How can i modify the settings so that i shall be able to run scripts under
> /var/www and also Django sites on localhost
>
> 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: Django - Forms Widget TypeChoiceField - how to set id for two radio buttons

2011-12-26 Thread Mengu
hi luke,

instead of setting auto_id to False, you should give it a string
parameter. please read more on
https://docs.djangoproject.com/en/dev/ref/forms/api/#ref-forms-api-configuring-label.

all the best.

On 26 Aralık, 21:45, luke lukes  wrote:
> hi everyone. i'm using a form with a TypeChoiceField, this is the form
> code:http://pastebin.com/GHttrDyN. now i'm trying to set a custom id
> for the two radio buttons displayed but i havent found yet the right
> way. maybe it's possible set it during form instantiation (as i set
> auto_id=False) in the view, but it's just my assumption, anyway i
> haven't find anything helpful on the internet.any idea?
>
> thanx - luke

-- 
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: USStateField default value

2011-12-31 Thread Mengu
hi erisa,

please try passing "initial" instead of default.

On 31 Aralık 2011, 23:52, Erisa  wrote:
> I wanted to have a select box for the state with California as the
> default.  I first tried in my model the following:
>
> state = USStateField(blank=True, default='CA')
>
> This gave me the error "TypeError: __init__() got an unexpected
> keyword argument 'default'".
>
> But the following works (i.e., California is the default and I have a
> nice select box):
>
> state = models.CharField(blank=True, max_length=2,
> choices=STATE_CHOICES, default='CA')
>
> Could this be a bug?  I am using 1.3.

-- 
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 should not login on multiple machine with same username and passowrd when user already login on one machine

2012-08-10 Thread Mengu
there are two simple ways.

have your own login view first. in your own login logic:

1) assuming you have a UserProfile model, add a field called is_online. in 
your login view after logging the user successfully, set the is_online 
field for this user to True.
2) if you are using redis or memcached instead of hitting the db, you can 
have a simple key like ("user_%s_is_online" % username)  and expire it 
until your session expires. 

depending on the way you choose, before logging the user in, you simply 
check if that user is online or not. if the user is online you can show an 
error message like "you are already logged in somewhere else."

On Friday, August 10, 2012 4:12:51 PM UTC+3, NIL ZONE wrote:
>
> user login on one machine, should not login on another machine with same 
> username and password in django
>

-- 
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/-/MxIPT_4bIl8J.
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: UnicodeDecodeError with non ascii app_label

2012-08-10 Thread Mengu
do you have "# -*- coding: utf-8 -*-" at the top of your file?

On Friday, August 10, 2012 4:29:01 PM UTC+3, vitalije wrote:
>
> Hello, 
> I have recently updated my django installation to version 1.4. 
> When I try to get an url that doesn't have a match in urlpatterns, 
> django-server replies with 500 server error and doesn't show usual error 
> page when DEBUG is on but in console shows an exception UnicodeDecodeError. 
> Here is log 
> Django version 1.4, using settings 'eprod.settings' 
> Development server is running at http://192.168.1.195:8100/ 
> Quit the server with CONTROL-C. 
> Traceback (most recent call last): 
>   File "/usr/lib/python2.7/wsgiref/handlers.py", line 85, in run 
> self.result = application(self.environ, self.start_response) 
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/handlers.py",
>  
> line 67, in __call__ 
> return self.application(environ, start_response) 
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 
> 241, in __call__ 
> response = self.get_response(request) 
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 
> 146, in get_response 
> response = debug.technical_404_response(request, e) 
>   File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", 
> line 432, in technical_404_response 
> 'reason': smart_str(exception, errors='replace'), 
>   File "/usr/local/lib/python2.7/dist-packages/django/utils/encoding.py", 
> line 116, in smart_str 
> return str(s) 
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 235, in __repr__ 
> return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__, 
> self.urlconf_name, self.app_name, self.namespace, self.regex.pattern)) 
>   File 
> "/usr/local/lib/python2.7/dist-packages/django/core/urlresolvers.py", line 
> 235, in __repr__ 
> return smart_str(u'<%s %s (%s:%s) %s>' % (self.__class__.__name__, 
> self.urlconf_name, self.app_name, self.namespace, self.regex.pattern)) 
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 18: 
> ordinal not in range(128) 
>
> I suppose that problem is app_label which is set to value u'Продавница'. I 
> know that I could use an ascii app_name, but I want django to show in admin 
> pages app_name like above. Does anybody knows how to solve this? 
>
> Thanks 
> Vitalije 
>

-- 
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/-/6ZDE5Ynh-mQJ.
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: Can I set a "global" variable after user login, to use in my view?

2013-01-22 Thread Mengu
hi fellipe,

if you enable auth context processors and pass in RequestContext to
render_to_response you can always access the user in your templates
which also means you can access the associated profile as user.profile
(assuming your model is named profile)

please read more at 
https://docs.djangoproject.com/en/dev/topics/auth/default/#authentication-data-in-templates



On Jan 22, 8:34 pm, Fellipe Henrique  wrote:
> Hello,
>
> It's possible, when the user make a login, I set one "global" variable, and
> get this value in my view?
>
> My question is because I have a inlineformset_factory, and I need to pass a
> user profile do my view.. but it`s doesn't work.
>
> Regards,
>
> T.·.F.·.A.·.     S+F
> *Fellipe Henrique P. Soares*
>
> *"Quemadmodum gladius neminem occidit, occidentis telum est."* (Epistulae
> morales ad 
> Lucilium,
> Lucius Annaeus Seneca)
>
> *"Any intelligent fool can make things bigger, more complex, and more
> violent. It takes a touch of genius -- and a lot of courage -- to move in
> the opposite direction."*
> Albert Einstein (March 14th 1879 – April 18th 1955)

-- 
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: Upload multiple files using Ajax

2013-01-22 Thread Mengu
i used jquery.form plugin back in the day. it worked great but it had
issues with large files.

check out http://malsup.com/jquery/form/progress3.html and
http://malsup.com/jquery/form/

On Jan 22, 6:05 pm, Andre Lopes  wrote:
> Hi,
>
> I need to develop a form to upload multiple files.
>
> I was thinking in using an Ajax uploader. I have google some options
> but there are to many and I don't know which one to choose.
>
> Any recommendations about this subject?
>
> Best Regards,
> André.

-- 
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 hosting companies

2013-01-29 Thread Mengu
some of my friends are using webfaction. i use linode and in the past
i have used webbynode.

On Jan 29, 3:17 pm, francislutalo  wrote:
> Anyone with an idea of which are the best companies to host my django
> applications?
>
> Thank you,
> Regards
> francislutalo

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