Friday, February 1, 2013

Re: Kindly help for an interview with Google on python django

On Thu, Jan 31, 2013 at 1:23 PM, Larry Martell <larry.martell@gmail.com> wrote:
> This is something I found back in 07 when I was offered a chance to
> interview there. I searched for it again, and there are links to it,
> but they don't appear to work. My situation was the strangely similar
> to Peter's - I also got an unsolicited call from someone at google who
> said they saw my resume, and "they wanted me." I hadn't applied at
> google, I wasn't looking for a new job, AND we were living in Santa Fe
> (where we still live). Odd.
>
> My Interview at Google
> by Peter Abilla
.........


my experience with google was different. i too was called by
surprise, without applying anywhere. I flew to their Zurich office
(from Perú) and spent a whole day with interviews. they were all
test-like, sometimes on the whiteboard, sometimes just chatting over
the table. didn't touch a keyboard. there wasn't any brain-teaser,
everything was computer, algorithms, datastructures, writing some
code, etc.

that happened twice, once in 2007 and again in 2010. in both cases
they told me after several weeks that "i wasn't a good fit for that
opportunity, but i should apply for another one"

in the end i had fun, found some motivations to learn new things after
that, and of course i liked walking on Zurich's streets and lake. but
the third time they emailed me (2012) i just declined the offer
instead of wasting my time.

--
Javier

--
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+unsubscribe@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.

Re: Polls tutorial receive object not object representation

> Now the only thing is that when I call p.choice_set.all() I don't get the representation 'The sky' or 'Just Hacking again' . I receive choice object itself. Is this normal?

It should be said that yes, that is normal. p.choice_set.all() is a list of Choice objects, not a list of strings attributes for each object.

You're right that it's not a very readable result, which is why the __unicode__ method exists to add a more user-friendly representation of that object for console/Django admin display. Still, don't lose sight of the fact that p.choice_set.all() is actually always returning a collection of Choice objects.

--
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+unsubscribe@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.
 
 

Re: get_absolute_url with custom extra parameter

I did use {% url %} before, but now it's not suitable for me anymore. The problem is my url pattern is a little more complicated than above example, sorry, I didn't want to confuse your with irrelevant code. I'm trying to implement a kind of SEO-frendly urls using slugfield album.url like this:

    def _get_absolute_url(self, view='t'):
        return reverse('show_album', args=[view, str(self.id)]) + self.url

Of course I can concatenate {% url %} with album.url right in the template to archive the same results, but I believe this would be a really bad practice. The obvious solution is to pass an argument to get_absolute_url. This is what my question was about. Since it's impossible, I'll remain with what I already have:

    def _get_absolute_url(self, view='t'):
        return reverse('show_album', args=[view, str(self.id)]) + self.url
    def get_absolute_url_f(self):
        return self._get_absolute_url('f')
    def get_absolute_url_t(self):
        return self._get_absolute_url('t')
    def get_absolute_url(self):
        return self._get_absolute_url()

Not very nice but at least it works.
Thank you for your answer, I really appreciate your advice.


четверг, 31 января 2013 г., 15:42:28 UTC+4 пользователь Daniel Roseman написал:
On Thursday, 31 January 2013 05:35:05 UTC, Sammael wrote:
Thank you for your answer!

I have a photo album which can be displayed in two modes: full (with url like 'album/id/full') and thumbnails ( like 'album/id/thumbnails' ). I would like 'get_absolute_url' to return a corresponding url depending on the given mode, something like {{ album.get_absolute_url full }} and {{ album.get_absolute_url thumbnails }}

The only solution I could find is to use two different functions: get_absolute_url_full and get_absolute_url_thumbnails. It works but it's ugly, I don't like it at all.

Any advice is greatly appreciated.


You should think about using the `url` tag, which does take arguments and seems to do what you want already:

    {% url 'album_full' album.id %}
    {% url 'album_thubmnail' album.id %}

Then your urls.py looks like this:

    url(r'/album/(?P<id>\d+)/full/$', full_album_view, name='album_full'),
    url(r'/album/(?P<id>\d+)/thumbnails/$', full_album_view, name='album_thumbnail'),
 
and if you still need the `get_absolute_url` function you can use the `@permalink` decorator to reuse the logic in urls.py
--
DR.

--
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+unsubscribe@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.
 
 

Re: Announcing new django project

> Looks pretty cool, and maybe this is just my naivety at work, but how does form validation work with this?

It's actually pretty simple. A form is generated on the fly for each editlive field using modelform_factory:
https://github.com/h3/django-editlive/blob/master/editlive/adaptors/base.py#L45

Then when saving, I check the form for field errors:
https://github.com/h3/django-editlive/blob/master/editlive/adaptors/base.py#L195

It might be useful eventually to add support for custom forms, I don't think it would be very hard to implement.

Regards,

--

  Maxime Haineault
  Consultant Web / Associé

∞ Motion Média 
   http://motion-m.ca
   m...@motion-m.ca
   (450) 747-0862

On Friday, February 1, 2013 8:12:32 AM UTC-5, JoeLinux wrote:
Looks pretty cool, and maybe this is just my naivety at work, but how does form validation work with this?

--
Joey "JoeLinux" Espinosa



On Fri, Feb 1, 2013 at 12:25 AM, h3 <hain...@gmail.com> wrote:
Hi everybody,

I would like to introduce you my latest project: django-editlive

It can make any database object editable in template with a simple template tag.

More informations, including demos and docs here: http://editlive.motion-m.ca

Feedback would be appreciated.

--

  Maxime Haineault
  Consultant Web / Associé

∞ Motion Média 
   http://motion-m.ca
   m...@motion-m.ca
   (450) 747-0862

--
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...@googlegroups.com.
To post to this group, send email to django...@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.
 
 

--
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+unsubscribe@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.
 
 

Re: get_absolute_url with custom extra parameter

Really interesting solution, I didn't think about using template filters, thank you.
I think it's too complicated for this task, but I'll surely keep this in mind, this can be very useful.

четверг, 31 января 2013 г., 15:29:54 UTC+4 пользователь ke1g написал:
The template language does not allow for the passing of arguments to model methods.

Two methods does not seem ugly to me.  But if you feel that you need something else, you could write a template filter used something like:

  {{ album|get_photo_url:"thumbnails" }}

The implementation of the filter is in python, and could pass the argument when calling album's method.  (I'd suggest not calling the method "get_absolute_url", however, because that name is special to Django, and is not expected to take such an argument.)

Bill

On Thu, Jan 31, 2013 at 12:35 AM, Sammael <s4m...@gmail.com> wrote:
Thank you for your answer!

I have a photo album which can be displayed in two modes: full (with url like 'album/id/full') and thumbnails ( like 'album/id/thumbnails' ). I would like 'get_absolute_url' to return a corresponding url depending on the given mode, something like {{ album.get_absolute_url full }} and {{ album.get_absolute_url thumbnails }}

The only solution I could find is to use two different functions: get_absolute_url_full and get_absolute_url_thumbnails. It works but it's ugly, I don't like it at all.

Any advice is greatly appreciated.

среда, 30 января 2013 г., 23:34:38 UTC+4 пользователь somecallitblues написал:
You can't pass parameters to model functions from within a template. What exactly are you trying to achieve?


On 30 January 2013 21:34, Sammael <s4m...@gmail.com> wrote:
Hello friends,

Is the any way to pass an extra parameter to get_absolute_url method of a model instance from template?

Thank you for your answer.

--
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...@googlegroups.com.
To post to this group, send email to django...@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.
 
 

--
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...@googlegroups.com.
To post to this group, send email to django...@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.
 
 

--
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+unsubscribe@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.
 
 

Share an apartment in Warsaw for DjangCon Europe

I am hoping to go to DjangoCon in May, arriving 14th departing 19th or 20th after the sprints.

Finances are tight - I am looking into apartments, which might be cheaper and more comfortable than a hotel. If anyone else is doing the same and would like to share, please drop me a line.

Thanks,

Daniele

--
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+unsubscribe@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.

Re: Announcing new django project

Looks pretty cool, and maybe this is just my naivety at work, but how does form validation work with this?

--
Joey "JoeLinux" Espinosa



On Fri, Feb 1, 2013 at 12:25 AM, h3 <haineault@gmail.com> wrote:
Hi everybody,

I would like to introduce you my latest project: django-editlive

It can make any database object editable in template with a simple template tag.

More informations, including demos and docs here: http://editlive.motion-m.ca

Feedback would be appreciated.

--

  Maxime Haineault
  Consultant Web / Associé

∞ Motion Média 
   http://motion-m.ca
   max@motion-m.ca
   (450) 747-0862

--
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+unsubscribe@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.
 
 

--
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+unsubscribe@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.